Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28539rwd; Wed, 17 May 2023 14:07:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Ir+tlrDqC6gSet9P6xu8zkM9hanFWarxcKfgLctiswBjpGDQvQ1Sayiz0Pe2SR5cfNkyP X-Received: by 2002:a05:6a20:42a9:b0:100:a2ca:7ca8 with SMTP id o41-20020a056a2042a900b00100a2ca7ca8mr42898699pzj.54.1684357650582; Wed, 17 May 2023 14:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684357650; cv=none; d=google.com; s=arc-20160816; b=Mz/Ls5NONjAAahoftqll24cYHAYgrJwpWdubKXq8aLtdg4hDX0Zv3kNmALZLZq8t9d +cCvFZif3CHmJHW1sGh/2tAG+8z5hSnO7Hj5Bx0/Fiy8IKwOm/CBnSYn8/OD4okZ+IZF CfragA/BjlIhrhIlxnexO7puRVMSHGi+ehAITz4yvFJY+5+GzkHbTg+to1UyghEHI5LS LvKFxko5w/Uy6Q2j56HosxZF8HiP2cPrGsblWv2gzGdD4FElPj3C29FNUmlYaztwnbAa C5ub0nHFAV1x6Ece4LEoE3j8vjjRMWCS1Ck++jae3en+TwgCIG5rRLrS8fXJlEbUb85i nh6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:feedback-id:dkim-signature:dkim-signature; bh=H5p3BP+00Lki0ST8KCunOuMh2yeCMco3Da8MtFm9HVY=; b=KFlVseadG8PQs2HbdNtwCFdBsMTrssI0qVhQS5eNdGu6ET7s3H0LBNfI+ePggyysvw 0BxC83rMw+VCvBL03EIGp5cBID5hOc+BDkX7TQkB+kBS6iBG5NFlfiyUGeD8sGO5IhVm xcoQAvI8FnZ3cXA6jeS2bc0z06PiKEu2R7cN4tQ/5saZ886WSa6ZTklEGcWRNWaw2otu mjWkbbvinCB+9rYHAc3hwsqqhWG27HboBL6m/13DDn+yu1xEf9KghYCtUQ06Ox9Mu+aj X4lBdvWAp5dopepwByIowuwsYQGjciv07h2r2TzlLOzRVRRL4Cm2A0Q1IE5YCzRqGQzi G3gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ryhl.io header.s=fm1 header.b="JFcvxX/u"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=HjwbxaQI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ryhl.io Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a637e4a000000b00524b3efc310si21353280pgn.83.2023.05.17.14.07.16; Wed, 17 May 2023 14:07:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ryhl.io header.s=fm1 header.b="JFcvxX/u"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=HjwbxaQI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ryhl.io Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbjEQUqO (ORCPT + 99 others); Wed, 17 May 2023 16:46:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjEQUqM (ORCPT ); Wed, 17 May 2023 16:46:12 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC604420B; Wed, 17 May 2023 13:46:11 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 432005C00D0; Wed, 17 May 2023 16:46:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 17 May 2023 16:46:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ryhl.io; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1684356371; x=1684442771; bh=H5p3BP+00Lki0ST8KCunOuMh2yeCMco3Da8 MtFm9HVY=; b=JFcvxX/uWdNMopUO+m88VnjPjJ3KtApbFqPSs40JHvt/avaIcTV SLYNqZ6GQyfJ5KYyc3KHjgxCnEvkN501E+uix1qES69V0gGSlJFk/ubYM+wKOl65 PUabT7LaaeSas/okYgydQoOAHre3tA13Ig+946NAsgckHdCIqt/4xXidwv+KXIk6 lqWcWXVyf1n2HN5N94tMTDDuHHTE+Fu2rVx1ObrX+PZWhkcmG9Xsn3tOYTsZhI/9 XmSZvhQu7q8E70SKTb4zI6U65+n2g4JfOwbTSpligfG0LNkI2tp5nQOAy9C1G8+k 0twcsF1Ddn0cFxAd1wE28a0JB8U8abpiASw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1684356371; x=1684442771; bh=H5p3BP+00Lki0ST8KCunOuMh2yeCMco3Da8 MtFm9HVY=; b=HjwbxaQIUVuPzR+yx1BuwI0L/Ed5y5qiOdPOI/xw1qV8wOIOoTD O2QzvMDydtM/QIDcWjDCpXVr/14CFmhzP6x5i66zLf9DZHqe6EYo7AncncvgU/8k dSqS1KEZH1pjYAOi/AbdrmQLApbGmKlml7YDjXRNH6CCGFSjFRDQwe5wAmnBeCQ7 9gbkV/cC5uvTNn5Vng3rAxXr/IP0KK16bkPMhwnRUsK58Ukh+9fpwPSPPJXKUO/e u5/MdblSHsRaDVnxQbEeNM0ivnpImv6bAU4N/Bu+QLpUT7FeRprC5eY/W/jYZpl4 EFCLQdrsB5V3jsn7cFS0hnRZm759aRS31mA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeiuddgudehfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomheptehl ihgtvgcutfihhhhluceorghlihgtvgesrhihhhhlrdhioheqnecuggftrfgrthhtvghrnh epheduuddvteekvdektdduledugfffhfdugeejgeeuvdevtdetveejheehiefffeegnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihgtvg esrhihhhhlrdhioh X-ME-Proxy: Feedback-ID: i56684263:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 May 2023 16:46:08 -0400 (EDT) Message-ID: <9ee86168-f470-23fe-5e1e-47b984ca069e@ryhl.io> Date: Wed, 17 May 2023 22:46:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH 3/4] rust: macros: replace Self with the concrete type in #[pin_data] Content-Language: en-US To: Benno Lossin Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=c3=b6rn_Roy_Baron?= References: <20230424081112.99890-1-benno.lossin@proton.me> <20230424081112.99890-3-benno.lossin@proton.me> From: Alice Ryhl In-Reply-To: <20230424081112.99890-3-benno.lossin@proton.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/24/23 10:11, Benno Lossin wrote: > When using `#[pin_data]` on a struct that used `Self` in the field > types, a type error would be emitted when trying to use `pin_init!`. > Since an internal type would be referenced by `Self` instead of the > defined struct. > This patch fixes this issue by replacing all occurrences of `Self` in > the `#[pin_data]` macro with the concrete type circumventing the issue. > Since rust allows type definitions inside of blocks, which are > expressions, the macro also checks for these and emits a compile error > when it finds `trait`, `enum`, `union`, `struct` or `impl`. These > keywords allow creating new `Self` contexts, which conflicts with the > current implementation of replacing every `Self` ident. If these were > allowed, some `Self` idents would be replaced incorrectly. > > Signed-off-by: Benno Lossin > Reported-by: Alice Ryhl It seems like you're missing a newline in the commit message? Reviewed-by: Alice Ryhl