Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp582633lqp; Fri, 5 Apr 2024 02:48:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6DTe2ZqczrlWoaZSc3o1xTIbCgbdTqBGE9b6BOUo4ius4seiGHGHr97jQqF+GQ42fJGZ3iSzYFydbLAGyb8Jl3FkQ8hqNgg4ReKTzow== X-Google-Smtp-Source: AGHT+IEROZn+v27h+fX9HlpqEKbI4luuiwk+mZ/33sLO0ydJG11O5hg9hXQPN+E/CLIChY9m4++w X-Received: by 2002:a50:f60a:0:b0:56e:2273:6548 with SMTP id c10-20020a50f60a000000b0056e22736548mr718505edn.8.1712310490731; Fri, 05 Apr 2024 02:48:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712310490; cv=pass; d=google.com; s=arc-20160816; b=J06NYmccVqE/dtggIS9L6tiE5lkTipAit/cublmRTs4D6St1e3rTJ5tSC6hD5Lae0M ZxWD7Pw9rox0vNtLxWRB2+pNJBNYw2WM4nufBlOiMdM9zrINP3G4JL4e/V998i9X9U86 mhSM/jMPV4wOhaSa7MhVkZnVJ8XPBWblqYWhdSPqXIUATq4Vcp+n8nYU/72oQZYlq9CM ajAhaD/doPhAyIwC2k4M/33CmL9ARXYD0UN7riFHRFpzHS4j1Y2jHfA37UiMrsbgJtAk HOBpF2AeztIte0avir0jQAoFdaXmRrPAtX1UaYnmkWJhd3qgp/zyqSWV8bOGPIXqzAkJ rjhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=rLmpZrzNrBXqu+xt/ZCUi25drzPdpOCa8IMXdFNbdc8=; fh=1eN+strsLnX8cuvE+uTff7wY1KiEAf1jFO97IDCVf3U=; b=QTQd5DeyXx7u39gg8xOVZ/1gtyV1xzW1bVQL+HdJ4TIRMKjyM5GW+hykmGJZ6ODLD9 Ncskdib7Z+5wR29oeQQZWAlWZ8LxgnHg0DnIwxxod/tMdduazUgugG/mMT/wzn5AUS0Q gkJjFzuZyky/9pipe6YvP2okMKwFYYnZplayv5LQHmd4EqpQmGPuaG34mAoXNDs6b3AA OaoGkQzVqsVCQg/PKKaD/fVnn0ZYQAjI9Og4Csifb9E40gwxGKSeCt1GicIwDnPNLzby SqcXAlmBhtyRQDT155YL9ZQXBVaaNiqvEUaeJqluqJF0MeXtpJQHtOBHFX98X/yavLxS j+GA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=JvxeNbEq; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-132759-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bl9-20020a056402210900b00568addbead2si584686edb.521.2024.04.05.02.48.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:48:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132759-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=JvxeNbEq; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-132759-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4B1B41F22DA6 for ; Fri, 5 Apr 2024 09:47:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 643CB16088F; Fri, 5 Apr 2024 09:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="JvxeNbEq" Received: from mail-40131.protonmail.ch (mail-40131.protonmail.ch [185.70.40.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C32AD1A26E; Fri, 5 Apr 2024 09:47:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712310456; cv=none; b=XHGNmMzBjuLku9OWIs/fVbra6DCSvTxuOlpMBrQkqqV/kDBudj27l0xEcbsrBz2AXOe6astT9zjsUzuAlLgmEDPDz1Qhc6KMUFyiZpDZBKLS4IlK16Nsz8f8+bw9hzvgzKThwYbGc86TNxxAOnGU60KBIaQWEcUlmOAjJ28IiQk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712310456; c=relaxed/simple; bh=F5izhsD4G3SI0Rk/8S99UY1gDQNUNsaPEQp+ZSnHcRk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PpI0RB1oNz3NiJYfgxFMh8/uc64dWwZNIUuzsF5rNw9jMM0dcf1zp3bHOpwgw7SfiNp/xdcym8EgKog9/6tc6R/t9lUmYbX6FDpmcLKqZJI+z6ddoKtNS0Dpa5rJhi8HWGh4/zNLbT8a1Xi2fz7DkL0Wltn8t7+UsfLrN2Uc1Kc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=JvxeNbEq; arc=none smtp.client-ip=185.70.40.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1712310452; x=1712569652; bh=rLmpZrzNrBXqu+xt/ZCUi25drzPdpOCa8IMXdFNbdc8=; 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=JvxeNbEq6egthg86ERFlZgIt8Ffa9WRNQao5xrKEbdogccX8tJ6XU221TPPj2oQf8 +WaBVkqK9vGY2GN8knfFKUUawkgrphu35+Df/7uUmYBzN9p7SbQn/fP5sHxFX00avv 1m040ef2uOOXUPOcy6wybgQ/w9MM5vV8qzI9XCpmcegAVLaYeKypQujds0S18Nas0A CcQ+PM3vx84lfVewXxF6EPsog5kh1acT/eSAP0gtGUfwNwSuLwmre4ZtkDNAigXm3O NLRxUO1VLMJmUAOULSMuDPiYUOJl9kTJawsZHuD5pQSrE5h68Px+ggGSEh+7RiHSK9 kmBLeBKKQoqow== Date: Fri, 05 Apr 2024 09:47:28 +0000 To: Alice Ryhl , Miguel Ojeda , Andrew Morton From: Benno Lossin Cc: Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Marco Elver , Kees Cook , Coly Li , Paolo Abeni , Pierre Gondois , Ingo Molnar , Jakub Kicinski , Wei Yang , Matthew Wilcox , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH 3/9] rust: list: add struct with prev/next pointers Message-ID: In-Reply-To: <20240402-linked-list-v1-3-b1c59ba7ae3b@google.com> References: <20240402-linked-list-v1-0-b1c59ba7ae3b@google.com> <20240402-linked-list-v1-3-b1c59ba7ae3b@google.com> Feedback-ID: 71780778:user:proton 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=utf-8 Content-Transfer-Encoding: quoted-printable On 02.04.24 14:17, Alice Ryhl wrote: > +impl ListLinks { > + /// Creates a new initializer for this type. > + pub fn new() -> impl PinInit { > + // INVARIANT: Pin-init initializers can't be used on an existing= `Arc`, so this value will > + // not be constructed in an `Arc` that already has a `ListArc`. > + ListLinks { > + inner: Opaque::new(ListLinksFields { > + prev: ptr::null_mut(), > + next: ptr::null_mut(), > + }), You might want to implement `Zeroable` (using the derive macro) for this struct, since then you could just return `init::zeroed()`. You can also use that for the `ListLinksSelfPtr` in the other patch. --=20 Cheers, Benno > + } > + } > +} >=20 > -- > 2.44.0.478.gd926399ef9-goog >=20