From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (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 A2C8BE56A; Mon, 8 Sep 2025 02:08:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757297315; cv=none; b=TKfBhoBJ1r+Wf4slphl+yhT6+aX+c1tN9yzJ6c2yy0Ga1iIGmL2YsPDFIZ4YFi2cQWfIjjupnP0LZgHDjiRGNGycn41x4o9TK31Wse4g4dZM87yIJ1M9K98b6VENLWvf0epqaHVtLDJrMNfb1NNHs1reZ8CHc0sOQ8TTUiNDtZs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757297315; c=relaxed/simple; bh=+6vge6D5Rmxr8sGWIAM2plq0WDBQ7eYtTTfWmyKyGMY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eD4hu0D1RZqMFMS9fJWQN3FVL8CkLY5CGbbTC2krSabr8T/tVmLHWf4mHRYcxQZEJYv+NY1lLuJ7SPpS7hXsfKu61fMLXRCQsg4oZqAwYBtkb3ZYpb2NauHT3wjh8qUO6lG8A9A5ZbdISn56GYQkNhWLmzO68VcDEabjAP7YZ50= 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=ZBSM70Ax; arc=none smtp.client-ip=209.85.219.48 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZBSM70Ax" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-70ddadde2e9so30994576d6.0; Sun, 07 Sep 2025 19:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757297312; x=1757902112; 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=n5wvK9N0FAN5WWE/5m873xnm5UeYdKcL81Y7rv8hpKI=; b=ZBSM70AxDJaChSAH9d6rTkGXMM2j7CLBT+WDeH1qnyC2FMZohUy04AjYhXFsvCZ0A1 UjkTNN/doE4j7mz8S3IK8EyNquijZ29/rh4g239Hrzu7ZBh7JJpevzgGoNllA8Dy/pPC nj7sx4bRYmTjBaTv72p+Lh/JGBp7veWISEA8MN1iOW3eA3xzixuiBZhuNAlsyfJfbbZ0 tT83+yynBzkOaP7u+UU4MI2jhlgNWdkIfgRdgy2N5purjCISxtu8o6SSK2rjoUWhj8hk WkucKYeIFLztFARVOtqE1HXCXaY6mX2C7JWFAhsn7Amm5LrK/73FJtoFzdIGA6lPlCxs WifA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757297312; x=1757902112; 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=n5wvK9N0FAN5WWE/5m873xnm5UeYdKcL81Y7rv8hpKI=; b=HS8qchaM0cw9OQ4f4/9Mtt1ozadhG6tYZzFT+hmcB9+LzJPE1SMxKT9VexYY7oZFmA yoL0iWddLhWVPRl9QZx38WObxxVQ+q3+aVh+vQy0s+4Mxun90CkisnYNvyJD+ZNeh7f3 nzBHQuCfsZDu5KTxdvSIURPLLsf66b7F1pgzV5GMD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VUGstOgLkQRAUg== X-Received: by 2002:ad4:5e87:0:b0:72b:37ff:b877 with SMTP id 6a1803df08f44-7393950ed3fmr64869776d6.42.1757297312434; Sun, 07 Sep 2025 19:08:32 -0700 (PDT) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-720add660desm113280016d6.30.2025.09.07.19.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Sep 2025 19:08:32 -0700 (PDT) Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfauth.phl.internal (Postfix) with ESMTP id 6C0B0F40066; Sun, 7 Sep 2025 22:08:31 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Sun, 07 Sep 2025 22:08:31 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduiedvkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeeuohhquhhnucfh vghnghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecuggftrfgrthhtvg hrnhephedugfduffffteeutddvheeuveelvdfhleelieevtdeguefhgeeuveeiudffiedv necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsghoqh hunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqieelvdeghedtieegqddu jeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrghilhdrtghomhesfhhigihmvg drnhgrmhgvpdhnsggprhgtphhtthhopedukedpmhhouggvpehsmhhtphhouhhtpdhrtghp thhtohepuggrkhhrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlohhsshhinheskh gvrhhnvghlrdhorhhgpdhrtghpthhtohepohhjvggurgeskhgvrhhnvghlrdhorhhgpdhr tghpthhtoheprghlvgigrdhgrgihnhhorhesghhmrghilhdrtghomhdprhgtphhtthhope hgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegsjhhorhhnfegpghhhsehp rhhothhonhhmrghilhdrtghomhdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrh hnvghlrdhorhhgpdhrtghpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhm pdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuh X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 7 Sep 2025 22:08:30 -0400 (EDT) Date: Sun, 7 Sep 2025 19:08:29 -0700 From: Boqun Feng To: Danilo Krummrich Cc: Benno Lossin , Miguel Ojeda , Alex Gaynor , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Andreas Hindborg , Alice Ryhl , Trevor Gross , Fiona Behrens , Alban Kurti , Greg Kroah-Hartman , "Rafael J. Wysocki" , Bjorn Helgaas , Krzysztof =?iso-8859-1?Q?Wilczy=B4nski?= , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rust: pin-init: add references to previously initialized fields Message-ID: References: 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 Mon, Sep 08, 2025 at 01:33:26AM +0200, Danilo Krummrich wrote: > On Mon Sep 8, 2025 at 12:51 AM CEST, Benno Lossin wrote: > > I actually came up with a third option that looks best IMO: > > > > init!(MyStruct { > > x: 42, > > #[with_binding] > > y: 24, > > z: *y, > > }) > > > > The `#[with_binding]` attribute makes the macro generate a variable `y`. > > `x` & `z` don't give access to their value. (we of course should come up > > with a better name). > > > > Any thoughts? > > It may be a bit verbose is some cases, but it makes things pretty obvious, so > LGTM. > > How about just #[bind] or #[access]? #[shadow] or #[maybe_rebind] ? Or #[pin_ref], the last one is clear about the purpose. Regards, Boqun