[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72=db5jQhup8JGZT3_93orrVQt-5pwPvSQb3k5j-eW7rdQ@mail.gmail.com>
Date: Tue, 29 Oct 2024 19:29:54 +0100
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Rob Herring <robh@...nel.org>
Cc: Alice Ryhl <aliceryhl@...gle.com>, Saravana Kannan <saravanak@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...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>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>, Dirk Behme <dirk.behme@...il.com>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH RFC 2/3] rust: Add bindings for device properties
On Tue, Oct 29, 2024 at 6:58 PM Rob Herring <robh@...nel.org> wrote:
>
> I really want a build error if the type is wrong, then the _ case
> would be unreachable. No way to do that?
When you need to work with a set of types, you would normally define a
trait and implement it only for those traits, e.g. see
rust/kernel/transmute.rs. Then it is a build error if you don't
satisfy bounds etc.
Cheers,
Miguel
Powered by blists - more mailing lists