Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp3011657lqz; Wed, 3 Apr 2024 15:39:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXkmHavH2kSOEUIl2CGL/xTjzIPKnGGTR7Nvc/bw9jq2R5A0lz9QZ+sRvjwkwva0qqCvZlrO4tjBV7970KruHINvzf+X570k6tEGriTGw== X-Google-Smtp-Source: AGHT+IHLKjuRd25T6tmgbTl9Ihn1KagHeUvqhSvWi5A9eWAs8UAIOy44pVGWSy5w1o6+bFieqrlS X-Received: by 2002:a05:6830:454:b0:6e6:96d2:acbe with SMTP id d20-20020a056830045400b006e696d2acbemr576994otc.26.1712183964438; Wed, 03 Apr 2024 15:39:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712183964; cv=pass; d=google.com; s=arc-20160816; b=Aj9BBCvzDYSuS0ukQxJ/OZGRJssvKLHQMbwOXiQrN3Zqd6penEBFAYdiZ3smxnjJZp VfApZZiROeq1DqURmqm6onwhnFwzo84gEsxbyBVFQWcIcNteagsf06IwLt4A1X3o4UIQ WDGWJ9vE5xtY7KzZmDanP14UG71ZKpjN2EJZjdovppYcC9o6lG6nYHpq0ZAK+tQXlpVG +wQ1ulL9Lqxn86xCXIWzObrMakvBUJIQnYVyld5CSpxxaoLEf+ta9GhhWDgoszmT+uYq mOGNYBaOx0Lsy2Ox5uhUg0sepbRdKA8eS/Bn9XsTw7yQ5TBdi7mBhi438ZK5XrYswO6n FD1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature; bh=TB1/wBBkZIgyMqKIcB1OutaUx9UujRieCF/3v3a0obA=; fh=DQgAGWguJTIDh6lJ//i/Z8XBTxzl+XQ3XwHUjVj6A+I=; b=BiHlLc20lPyd5y+Rz7vpH74UVstH0UYtnTv8OelJg8J11OLzmKADq5vZWYI7g82JvQ ZcOh4b1LFOYFIPxkKe7QOZLEu4098exEg+VTPOzTTTFN5uI9aebBf9QjI+N79nc8a3AO W8wU/RXZE9iglQnCJ4e+jVRd58YjKszstdv02hlrDJeu+n3OzV5TpKSiduue51g7Fmxy j4eJLcoJVllmkSbNkO79EVVXmGPSar+umMZvLOqdWW7B4vOtt8wqlAkqFUh22sQDrT44 /IB18LNHi4SrwZSqFCk9tc/AozXbEe7D106ClNZckO/rCV3+/QhwHSeat1o5clLrsIg+ /s/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="LD93/V57"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-130691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130691-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d10-20020a05622a05ca00b004315b469699si15898205qtb.685.2024.04.03.15.39.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 15:39:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="LD93/V57"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-130691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130691-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1E0601C21436 for ; Wed, 3 Apr 2024 22:39:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DBDA156237; Wed, 3 Apr 2024 22:39:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LD93/V57" Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B596139D; Wed, 3 Apr 2024 22:39:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712183954; cv=none; b=j5hd3EySgu5oF5H8N6UZJoCeCfcGgACBLXCaxsbw66wmm2nXnfcdR/jE4c+RC03B8RLvruTUKc0V1cAF1Q52ky76MlS7296p4M6PAlEPzEtN/KYt+psNeiuu9qUMfBz0UI5H/3eGRsjT6ThxmBDBj4J/2z0xp1cl+2DkpZTczpU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712183954; c=relaxed/simple; bh=6RRNO8tHGPyVuBWqXC6p54ck9E+UFQ4pHjzqX4Kv410=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RGNChqjaZVXoMBTVYZOAJSLnmAnz84mWeuEJnUO9/l9CTxF7D/YZugDfIStUtNTq4zMcA3rHjqKlru8d5u/QFn4gWtrLwf4nfokLpzPRjWRFwhqa+zJVpa6BMVhTtXaDzhWVYo5hcKu3d23j72YbRkTeEM4KUTAhmQZIKebak2M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LD93/V57; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-696315c9da5so1835196d6.2; Wed, 03 Apr 2024 15:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712183952; x=1712788752; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=TB1/wBBkZIgyMqKIcB1OutaUx9UujRieCF/3v3a0obA=; b=LD93/V57XNKKLi6f9u+YX1ABD3Iojls1OS+pBORSb/KFFqQU1DBSEn98uWEfpM+vwW QCstzOPu3YIhEVidYyc3b5aw7zfhs7L9zxDiJPMeAqm45LoSEO1NEjZS8IAKVpcR2C02 FVKetIWiC3OOgBnQgbggfSWMaWZdkN5osCPzY8uW0F4LK44hhZYmA1+/btQTtQ2TL5RR ZF872Zy16i3ByhhwaC5D/qPExKH4OtgekfuwvXHyH82WiyFdkV9spb4GdecNYRk0gSR9 Sq4zZU5Po5e4BN6ShLVpvOuTNlvk19gaW/QUdcZBe7EY+szbDwcn6NTrF8Zk4tuHxTX5 PtIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712183952; x=1712788752; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TB1/wBBkZIgyMqKIcB1OutaUx9UujRieCF/3v3a0obA=; b=q5XIfQYr+MkcVMApHluLDbIuSlgy1nvcZes04elzoK/j93/ssdPXXAoN5CMACwUZeR JEwGnzmCysF/pQERnvdxdV2NZerJU64htVSqbHrsxHaY4DS+Nhaq1AUKFm5XIX328IFA Vj78AdRoYhsS7qmWdFVeTjuR3ZgL5YUWg/e2+EwyEXlEhz6DYYhs5scXQmWY5Yj647Vf at8QaLVKyLXYMZQOEwjxTj1My1q+cUH2DKuHiB3476aroAX7nybBvI4SZwVlXhft7KgC CEMKW1oaeTYYMlXXLOnU6ZKYifDtQP4TutgdwHTdmQ0UGooxQa4l+Mf6RT8k0YV8tcxf 4xIw== X-Forwarded-Encrypted: i=1; AJvYcCUdWWill5HlhHeo5seXDxbzPU5KXpqC3nLG21LL7fWID9umLsRObDn2BuGUo8SBqNMrz02mGJYRYNz3D3Occ8zAet+9o4xPfXkrq5EAxxj2to1r5JZCN+CiJI9Gai2bica5N471scJpvvuqWaE= X-Gm-Message-State: AOJu0Yw039sK+8fIHu0sSkhajCrO4ojojTsrpVJ9lo2mO3d4WxMqSop9 FPzsHcwlBjdgg+Tr0j1fWQEKZO9JC3S8va6m9GZxz9Mi93dDaIbU X-Received: by 2002:a05:622a:4ca:b0:434:3358:8a11 with SMTP id q10-20020a05622a04ca00b0043433588a11mr883268qtx.55.1712183952244; Wed, 03 Apr 2024 15:39:12 -0700 (PDT) Received: from fauth1-smtp.messagingengine.com (fauth1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id bb15-20020a05622a1b0f00b004344c996355sm225420qtb.79.2024.04.03.15.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 15:39:11 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfauth.nyi.internal (Postfix) with ESMTP id AC64A1200032; Wed, 3 Apr 2024 18:39:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 03 Apr 2024 18:39:10 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpefhtedvgfdtueekvdekieetieetjeeihedvteehuddujedvkedtkeefgedv vdehtdenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhh phgvrhhsohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunh drfhgvnhhgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgv X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 18:39:10 -0400 (EDT) Date: Wed, 3 Apr 2024 15:38:12 -0700 From: Boqun Feng To: Benno Lossin Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Andreas Hindborg , Alice Ryhl , Martin Rodriguez Reboredo , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rust: init: change the generated name of guard variables Message-ID: References: <20240403194321.88716-1-benno.lossin@proton.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Apr 03, 2024 at 10:09:49PM +0000, Benno Lossin wrote: > On 03.04.24 23:20, Boqun Feng wrote: > > On Wed, Apr 03, 2024 at 07:43:37PM +0000, Benno Lossin wrote: > >> The initializers created by the `[try_][pin_]init!` macros utilize the > >> guard pattern to drop already initialized fields, when initialization > >> fails mid-way. These guards are generated to have the same name as the > >> field that they handle. To prevent namespacing issues when the field > > > > Do you have an example of this kind of issues? > > https://lore.kernel.org/rust-for-linux/1e8a2a1f-abbf-44ba-8344-705a9cbb1627@proton.me/ > Ok, so a new binding cannot shadow the name of a constant, that's a bit surprising, but seems makes sense. The solution is not ideal (for example, a constant can have the name "__something_guard"), but nothing better we could I guess. FWIW: Reviewed-by: Boqun Feng Regards, Boqun > -- > Cheers, > Benno > >