[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72kXGNyLg0Ooo3Ne=KmZWBnSO9HE2tcfP=gf+WGFqnjDEg@mail.gmail.com>
Date: Thu, 26 Sep 2024 23:56:08 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Benno Lossin <benno.lossin@...ton.me>
Cc: kernel test robot <lkp@...el.com>, 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>, llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
Greg KH <greg@...ah.com>, Simona Vetter <simona.vetter@...ll.ch>, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v2 1/2] rust: add untrusted data abstraction
On Thu, Sep 26, 2024 at 11:40 PM Benno Lossin <benno.lossin@...ton.me> wrote:
>
> I would like to use `#[cfg("rust version <= 1.82")]`, but I don't know
> how to do that. Do we already have support for checking the version in a
> cfg? The alternative would be `#[allow(unreachable_patterns)]`, but I
> would like to avoid that.
We can do it, but it requires adding a Kconfig symbol, sadly, since
`cfg` does not support numerical comparisons there.
See commit 93dc3be19450 ("docs: rust: include other expressions in
conditional compilation section") where I explained it.
So depending on how often we think we will hit this, we may want to
pay the "cost" of the extra Kconfig symbol. Otherwise, we can just
`allow` it as you say.
(There are discussions in Rust about `cfg(version(...))`, but that is
for the future -- I have some links at
https://github.com/Rust-for-Linux/linux/issues/354)
Cheers,
Miguel
Powered by blists - more mailing lists