From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (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 E186B18D64D for ; Tue, 6 Aug 2024 14:11:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722953499; cv=none; b=njl+aYwCqFiMhSzbnxSeggm8t84P92zMsuBFTJwldgaAixVveLwRNOiXwOhkZOWmuuqF/bZYI2Sghme0gaXOD2ibC/nSKmThZPY+LWafKTUD2M6mcDxzkz0edHmjbzO9ZCgXwbf1CjkjPG5Y+DoCiQhVQAC68aroud8JbbIMD6c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722953499; c=relaxed/simple; bh=epdSBWYsFtSGCN/sAFMpeTs3Vq1++V7uVSBtRlfKs/U=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DWUO9XCKmGuP/G4KDF8qPs6T+SM8IORTIWTFTjhwCsngJiBURYDTQmJB2Ip6acXrHxefyLU9BBb7DMnrs1k7szYBZqVqF57EW3IY/ZUN8FZ7xpdBY8xIA20Mbzo5O0ezRkiXqiQsmrB/aLuVW+UTx7yisGt/iM6EebjBt4hCTEI= 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=Nw93WDo7; arc=none smtp.client-ip=185.70.43.16 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="Nw93WDo7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1722953496; x=1723212696; bh=Wn9ajIuhXlmQGQC4Z3aaXlblA2FS/BHrUmpEPNRSJMs=; 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=Nw93WDo7bbs2e0F/WSGYDF7vlAbvzoxpQrtLpUY7cEAHTu0mUoY3NB4dTjVip0nY9 fk4C/qNULelaYbwrVxhMcUgXmZ+QphpvFaNyuDeVdlAjhcOwVBHsph6G/ec8ROaWzX TKvzVN10DeMem7SvnhMfgQMZDFvXr76Yx6q7I1nL5B2BFHSc8QojgABmOwXnl0Qejb ImFnsSVszODD42P0LCOF8bFRQ5zJSTB5fx6Pl7FJYqCJBgP8LZnHfnjEN6q8n6Su4o bavLa7BYDIIFjM9leM2sHpboP6NOVb9EnU68L+trMOd11v0fY7X4xV9e22RfUcONiC 4G/cfzKe1gYGA== Date: Tue, 06 Aug 2024 14:11:30 +0000 To: Alice Ryhl From: Benno Lossin Cc: Miguel Ojeda , Andrew Morton , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Marco Elver , 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, Kees Cook Subject: Re: [PATCH v3 02/10] rust: list: add ListArc Message-ID: <62158f09-2882-475e-9df5-6d5f26d788ff@proton.me> In-Reply-To: References: <20240723-linked-list-v3-0-89db92c7dbf4@google.com> <20240723-linked-list-v3-2-89db92c7dbf4@google.com> <037f16f4-e959-4801-90b2-aafb7afcfdb6@proton.me> Feedback-ID: 71780778:user:proton X-Pm-Message-ID: fe7f3057b63d16835113d52422aaecd277e99b60 Precedence: bulk X-Mailing-List: rust-for-linux@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 06.08.24 15:16, Alice Ryhl wrote: > On Wed, Jul 31, 2024 at 6:47=E2=80=AFPM Benno Lossin wrote: >> On 23.07.24 10:22, Alice Ryhl wrote: >>> + // INVARIANT: By the safety requirements, the invariants on `L= istArc` are satisfied. >>> + Self { arc } >>> + } >>> + >>> + /// Transmutes a `ListArc` into an [`Arc`] without updating the tr= acking inside `T`. >>> + /// >>> + /// After this call, the tracking inside `T` will still think that= there is a `ListArc` >>> + /// reference. >>> + #[inline] >>> + fn transmute_to_arc(self) -> Arc { >> >> Maybe also change this then to be consistent, since the name `transmute` >> carries a "dangerous" feel to it, but this is actually totally safe. >=20 > I want it to carry a dangerous feel! Yes, it's safe to leak the > ListArc, but you don't want people to think it's a generic ListArc -> > Arc conversion function. For me `to_arc_unchecked` would also "feel" dangerous, transmute is just more dangerous :) Since this is not public I don't mind keeping `transmute`, I just find it a bit strange. --- Cheers, Benno