lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DBP8RFDV59PF.1OV46P0UYKOGM@kernel.org>
Date: Wed, 30 Jul 2025 10:20:09 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Daniel Sedlak" <daniel@...lak.dev>, "Daniel Almeida"
 <daniel.almeida@...labora.com>, "Michael Turquette"
 <mturquette@...libre.com>, "Stephen Boyd" <sboyd@...nel.org>, "Miguel
 Ojeda" <ojeda@...nel.org>, "Alex Gaynor" <alex.gaynor@...il.com>, "Boqun
 Feng" <boqun.feng@...il.com>, "Gary Guo" <gary@...yguo.net>,
 Björn Roy Baron <bjorn3_gh@...tonmail.com>, "Andreas
 Hindborg" <a.hindborg@...nel.org>, "Alice Ryhl" <aliceryhl@...gle.com>,
 "Trevor Gross" <tmgross@...ch.edu>, "Danilo Krummrich" <dakr@...nel.org>,
 "Rafael J. Wysocki" <rafael@...nel.org>, "Viresh Kumar"
 <viresh.kumar@...aro.org>
Cc: "Alexandre Courbot" <acourbot@...dia.com>, <linux-clk@...r.kernel.org>,
 <rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 <linux-pm@...r.kernel.org>
Subject: Re: [PATCH] rust: clk: use the type-state pattern

On Wed Jul 30, 2025 at 9:29 AM CEST, Daniel Sedlak wrote:
> On 7/29/25 11:38 PM, Daniel Almeida wrote:
>> +    mod private {
>> +        pub trait Sealed {}
>> +
>> +        impl Sealed for super::Unprepared {}
>> +        impl Sealed for super::Prepared {}
>> +        impl Sealed for super::Enabled {}
>> +    }
>
> I just noticed we have plenty of Sealed traits scattered across rust/ 
> folder. Do you think we would benefit from unifying it to a single 
> location to prevent duplication?

I don't think we can merge the various `Sealed` traits we have. They are
implemented for different types and ensure that only those selected
types are allowed when `T: Sealed`. If we merge them, then that is no
longer the case.

We essentially would like to have a `#[sealed]` attribute that we can
put on a trait to avoid the `mod private { pub trait Sealed }` dance.
(so a trait that cannot be implemented outside of the module declaring
it)

---
Cheers,
Benno

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ