[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72nd0Pfv4TrpULGQ_fZkyBpHyVVZ1H45_RJBgBxkJuzCJQ@mail.gmail.com>
Date: Thu, 1 May 2025 16:08:11 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Andreas Hindborg <a.hindborg@...nel.org>
Cc: Danilo Krummrich <dakr@...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>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>, Joel Becker <jlbec@...lplan.org>,
Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>, Fiona Behrens <me@...enk.dev>,
Charalampos Mitrodimas <charmitro@...teo.net>, Daniel Almeida <daniel.almeida@...labora.com>,
Breno Leitao <leitao@...ian.org>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 1/3] rust: configfs: introduce rust support for configfs
On Thu, May 1, 2025 at 1:32 PM Andreas Hindborg <a.hindborg@...nel.org> wrote:
>
> The one just before the cut?
Both.
> Thanks. Would be nice with a lint for missed intra-doc links.
Definitely -- I filled it a while back:
https://github.com/rust-lang/rust/issues/131510
> Clippy gets mad if we move it up. Because rustfmt wants the unsafe block
> to a new line:
Yeah, then it is one of the cases I was referring to. In that case, it
is fine, but please indent the safety comment to match the `unsafe`
block.
> The reason I choose build_error is that if this should somehow end up
> being evaluated in non-const context at some point, I want the build to
> fail if the condition is not true. I don't think I get that with assert?
I am not sure what you mean. My understanding is that `const` blocks,
if execution reaches them, are always evaluated at compile-time (they
are a const context):
https://doc.rust-lang.org/reference/expressions/block-expr.html#const-blocks
e.g.
https://godbolt.org/z/h36s3nqWK
We are lucky to have Gary with us, since he stabilized this particular
language feature, so he can correct us! :)
Cheers,
Miguel
Powered by blists - more mailing lists