Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10249730rwp; Thu, 20 Jul 2023 17:40:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlHU6amfJr7UP7GRDu5rY7iswbYZjVH5A9lMTtCtmUwtXTCC+CdvH/IHpqawAQnao4TLjDNj X-Received: by 2002:a05:6a20:1053:b0:137:23f1:4281 with SMTP id gt19-20020a056a20105300b0013723f14281mr388063pzc.12.1689900037541; Thu, 20 Jul 2023 17:40:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689900037; cv=none; d=google.com; s=arc-20160816; b=eH0UXuARKudk6MvZ3OYu9T347GzYzgqXV/lkT3gA1sHh5ZNQ7vSoH8kpv71d8342mo dq4gI2BUEGsafpEizl1jKYvgpbE2Mlyuk1ghiH50+N/3s9OTFa/MgNNTrul/skcHPLQz cDBRU7AlnSrJGhTYXrl/rW2uDztjpZryO+sro5lRPOCVzTbH2Z8Pi2czonl9KIjfsMS+ rkSzYsdGRcDpLg9HTtp1Fz/FRq6LDztAieP7jt682NactYDzMo3sEqT8LqeeWD+Wi2WJ bg5vdTdeaFZT02TYvB7sjvF+qYY11g+KX4dqnxpCHnWFTGz4dyEGzsm1w+2HhQEYoA6w TSdw== 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:dkim-signature; bh=o65wHm+GCCRza8lHZdua95nzqOaSV3elekh8FSqfMec=; fh=QIytb8Pc/tNQKCXmppbqLtpd0hrzmewt+SvaGVZrVJI=; b=GQaZwfzc1ST8z/S8DvNvamjp/KaByTAzufOr7Bueig5odE4sDgyjzSLbfQSr/nDxHh PtXwveln8SjWaoJGbHv3QdRtoK6tC88cY7HncTYre1SjOAkcmdvTfFhR84T48mtR2AC1 1RqSUFtDAxROZb9PiaTb3lQuaR+NJzwsOJLhiURs2Lo8LS7KJpNzd8KbscoRKyT/n6hK +q8wD1ZH91ReHz4rzsz7sXupvkVrnidTqJCN3FGr2ETDNwLzLwpni2be2LfCUnfzbkRn srua5OZpuVFWADVGZqeNvuum6Hxez6oBqJ0uOn/pqdZ1oJ2mW+uOLGM3LBB2mR/vfAc3 lDzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=he35k3gY; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c16-20020a170903235000b001b89bd6fd59si2133260plh.215.2023.07.20.17.40.23; Thu, 20 Jul 2023 17:40:37 -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=@gmail.com header.s=20221208 header.b=he35k3gY; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229933AbjGUAZU (ORCPT + 99 others); Thu, 20 Jul 2023 20:25:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230027AbjGUAZS (ORCPT ); Thu, 20 Jul 2023 20:25:18 -0400 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10B512D47; Thu, 20 Jul 2023 17:25:11 -0700 (PDT) Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3a3efebcc24so979614b6e.1; Thu, 20 Jul 2023 17:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689899110; x=1690503910; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=o65wHm+GCCRza8lHZdua95nzqOaSV3elekh8FSqfMec=; b=he35k3gYDV3/T18SyxesYpTF79XCzMit5Mflh87neU1B/a1ZD6Vg0yTRQhJWseEmii IOnW/hP/9yDwu+sQG9Kpdt8OWyfM/LiXpItgBhcHXyAc/KXskdlkWFPKAi4G/Xzin3eB 2ksDE7eUeq/YBLiT8WfRU4YBgRssQsvsZdTgCzTUiSjrM7ECTVdXFz8oElu1jwkW1QYX tfse5bMDaEzeL1c77gbxzsjXvuypGJkPGGl2i2TfTqiqGeIwEJyZ0eJXVBmy364ZFiZ5 9Ne7lk2gPWKjZ5Y+MjGADIF+5sXCVuxlbGWdcA/yjXva4A39YNiBhgxBTnD7/FR7h3Uk qMcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689899110; x=1690503910; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=o65wHm+GCCRza8lHZdua95nzqOaSV3elekh8FSqfMec=; b=SEqMKl1yyYpR7I2B4JJHBY9HCPesJX4fpiKoDEljxjlLB0UOv0b0aCNOxlYmtp7yxf R+HhqsH/ImPOkrL48ly6rSZoI9T5j1uZLUunfLP1EhYeLbZi+DfSU8pgGF01OuUNM712 1OYz11V21ZV3vfMcBC0boSDQtZLtp9O+6ntuaioMOvSlVcOoNzEE3oMlTPJe84DdaRnr qoqSC08W2CIW13u8f6UB0soHRIGcs2QiFd7gfzi2VO8b4Wh9843O06rAsEH+fA3FEr7+ VLfQ2l3MyBoWbxJliDavTIfD4JULPQBQP9COJGtseepaLHVV7igGb5NEm+ht53JULZMj YV4A== X-Gm-Message-State: ABy/qLaCbZIS+TXM7YZBSHU8fsij2BW/7pnFMjbfm/lqEKe+nInDEKSn LPIg0xgiVDxXf3036ur0oQM= X-Received: by 2002:a05:6808:1115:b0:3a1:d1d9:d59c with SMTP id e21-20020a056808111500b003a1d1d9d59cmr451461oih.33.1689899110197; Thu, 20 Jul 2023 17:25:10 -0700 (PDT) Received: from [192.168.54.90] (static.220.238.itcsa.net. [190.15.220.238]) by smtp.gmail.com with ESMTPSA id t25-20020a056808159900b0039ee1de4e6esm928210oiw.38.2023.07.20.17.25.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Jul 2023 17:25:09 -0700 (PDT) Message-ID: Date: Wed, 19 Jul 2023 16:04:40 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 03/12] rust: init: make guards in the init macros hygienic Content-Language: en-US To: Benno Lossin , Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor Cc: Boqun Feng , 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, Asahi Lina References: <20230719141918.543938-1-benno.lossin@proton.me> <20230719141918.543938-4-benno.lossin@proton.me> From: Martin Rodriguez Reboredo In-Reply-To: <20230719141918.543938-4-benno.lossin@proton.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DATE_IN_PAST_24_48, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 7/19/23 11:20, Benno Lossin wrote: > Use hygienic identifiers for the guards instead of the field names. This > makes the init macros feel more like normal struct initializers, since > assigning identifiers with the name of a field does not create > conflicts. > Also change the internals of the guards, no need to make the `forget` > function `unsafe`, since users cannot access the guards anyways. Now the > guards are carried directly on the stack and have no extra `Cell` > field that marks if they have been forgotten or not, instead they are > just forgotten via `mem::forget`. > > Suggested-by: Asahi Lina > Signed-off-by: Benno Lossin > --- > [...] Reviewed-by: Martin Rodriguez Reboredo