Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1249432rwl; Wed, 5 Apr 2023 14:09:18 -0700 (PDT) X-Google-Smtp-Source: AKy350bB83+V9+/bRdWfuw74g7bKQYLArzTQYN4Y6VlJhSASsue4PZTq+Q6KzD2B+jAeuF+5R8tT X-Received: by 2002:a05:6402:1519:b0:502:4c82:6cc0 with SMTP id f25-20020a056402151900b005024c826cc0mr2692869edw.40.1680728958708; Wed, 05 Apr 2023 14:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680728958; cv=none; d=google.com; s=arc-20160816; b=YHdlY5OvI5nXNCUiZ7WCl1aZfqmLK8IUampYBGhpNcO9OqL8iqsuRMDl06LHjSEhR+ 0WhpZgW0FE6jrmX2OHrUUDUH3i1xyvy5W41Xx5abcPzSJ3G/o4FdFPa9An3mwp2Mk7kn ihUxcWx3whN1kesjdZZs+NIt0qQw+oN3z4w8X9Bp5674EWevVf7hSlhcJfQCpMsHe46X EQtn//jsRWbxptZA+FzqcGBNTvXP7f7lQjOyyLC6QfMRW5sSPjHdXe/2KYdFJEFpNTte 1JmW5Zo2b0Zkcird+veKXZ3CxRfbm3c7jQ+fa9/1X7nrC6vlkIg4A5WKmnLGe8CnGiRQ yN8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=vuvbMSg3XgGBVCOc1uYn3lg/ER9MH4uDgroxzs+1l8E=; b=Dp1Y2C0/YdC0UUMFVwTvGPLqoOpm3rwPk2tefMNY/yIUiTwm55iaOoYIxpDxM4W579 BGhQQuaiC/Yd4nY+at6qaT3n7GhIf9qjX1wVSloRA9B7B12ODcr/GwQSoMygRez/yj5s DoXIU5IYbf3sUJcyRLsL990YO+7tmdn0xLXue/D6Brt9O4Nl1rA6W/uHpxLRpvXRlC3i mnmNXApFRL3V04g34l3gnZ9bQpXIacBQhZJaPXFjHROCqt2kLQUUHNK7+YNOP5MsYfS9 a0MWJeZ2V0Q/KBNGEqyoekQSwd0IYAkVyIB1B76hpQ4xSrbW2Jq4b8IvvThQLFgJvWny N+JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=HgxHNdKW; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f1-20020a056402004100b005024da27f37si4839293edu.510.2023.04.05.14.08.52; Wed, 05 Apr 2023 14:09:18 -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=@protonmail.com header.s=protonmail3 header.b=HgxHNdKW; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233867AbjDEVHI (ORCPT + 99 others); Wed, 5 Apr 2023 17:07:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233485AbjDEVHE (ORCPT ); Wed, 5 Apr 2023 17:07:04 -0400 Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC5FB6A47 for ; Wed, 5 Apr 2023 14:06:55 -0700 (PDT) Date: Wed, 05 Apr 2023 21:06:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1680728813; x=1680988013; bh=vuvbMSg3XgGBVCOc1uYn3lg/ER9MH4uDgroxzs+1l8E=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=HgxHNdKWBNVinVaxjMslfvKpcrbRvwG6Qgj/Kdzkgr3D1lO/PcwOm8I4VKBmjA+mL PCbM/1pl6emJRynHM1aSO9Fe7H9I8R0VrIRfhhgSlhj1yV87OdoihW3+IqzzufmDpy NNaQUZvBdYf6iU9ZFSff+r2K6XAtA60LESVxUxVwSqvRq5pRiicxilGXQhsiLr6+TO N7pWKTjBRzBbmMfnX5ySwJFqsH2D8e1dzmRl1HIpNhbTR8qUUEYNorblrle9xI27yX oC4NliS72Hlx287Umvkeud/Jr7p1rQGhZEgOrGCsHFoJIuo7Pmy30xbwx/owwEkqKP 0Cr/0EIFqPyvA== To: Boqun Feng From: Benno Lossin Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Alice Ryhl , Andreas Hindborg , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: Re: [PATCH v6 00/15] Rust pin-init API for pinned initialization of structs Message-ID: <96b35c6c-6fd1-465d-fb46-aa48c73ae465@protonmail.com> In-Reply-To: References: <20230405193445.745024-1-y86-dev@protonmail.com> Feedback-ID: 40624463:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 05.04.23 23:02, Boqun Feng wrote: > On Wed, Apr 05, 2023 at 07:35:30PM +0000, Benno Lossin wrote: >> Changelog: >> v5 -> v6: >> - Change `pinned_drop` macro to allow `mut self` in the signature. >> - Change statement fragment to tt fragemnt in `pinned_drop` to prevent >> parsing errors. >> - Move evaluation of the value in `stack_pin_init!`/`stack_try_pin_init!= ` >> to the beginning. > > Could you elaborate why? To make sure the $val evaluation happens > unconditionally? This is done to allow `stack_pin_init!(let value =3D value);` i.e. naming the variable the same as the expression that is evaluated. -- Cheers, Benno >> - Move setting uninitialized flag in front of dropping the value in >> `StackInit::init`. >> - Remove `Unpin` requirement on `zeroed()`. >> - Add note about `Pointee` to the `Zeroable` impl on raw pointers. >> > > Regards, > Boqun