[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aJnWxD7qyOOXz543@fedora>
Date: Mon, 11 Aug 2025 17:10:52 +0530
From: Ritvik Gupta <ritvikfoss@...il.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Tamir Duberstein <tamird@...il.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>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v4] rust: kernel: introduce `unsafe_precondition_assert!`
macro
> > + ($cond:expr, $($arg:tt)+) => {
> > + $crate::unsafe_precondition_assert!(@inner $cond, ::core::format_args!($($arg)+))
>
> Tamir, taking your fmt series into account, what's the correct
> replacement for ::core::format_args! here?
Whoops! I wasn't aware of the fmt-series! Thanks for mentioning it :)
After a quick search, `kernel::prelude::fmt!` type/macro [1,2] seems to be the relevant replacement.
So, the line would look like:
`$crate::unsafe_precondition_assert!(@inner $cond, $crate::prelude::fmt!($($arg)+))`
Does that sound right?
[1]: https://github.com/Rust-for-Linux/linux/blob/8f5ae30d69d7543eee0d70083daf4de8fe15d585/rust/kernel/prelude.rs#L36
[2]: https://lore.kernel.org/rust-for-linux/20250719-core-cstr-fanout-1-v2-4-1ab5ba189c6e@gmail.com/
Powered by blists - more mailing lists