[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72n7d89aHiM2fcHnEUE+9=0zyEAFmBoURi4O02w-isSiKw@mail.gmail.com>
Date: Thu, 19 Jun 2025 22:42:44 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Boqun Feng <boqun.feng@...il.com>
Cc: linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
ojeda@...nel.org, alex.gaynor@...il.com, gary@...yguo.net,
bjorn3_gh@...tonmail.com, benno.lossin@...ton.me, a.hindborg@...sung.com,
aliceryhl@...gle.com, tmgross@...ch.edu, dakr@...nel.org, mingo@...hat.com,
peterz@...radead.org, juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, vschneid@...hat.com, pmladek@...e.com,
fujita.tomonori@...il.com, mingo@...nel.org, tamird@...il.com
Subject: Re: [PATCH v4 1/2] rust: Introduce file_from_location()
On Thu, Jun 19, 2025 at 5:10 PM Boqun Feng <boqun.feng@...il.com> wrote:
>
> +/// // - A path like "rust/kernel/example.rs" if file_with_nul() available.
"is available."
> +pub fn file_from_location<'a>(_loc: &'a core::panic::Location<'a>) -> &'a core::ffi::CStr {
> + #[cfg(CONFIG_RUSTC_HAS_FILE_WITH_NUL)]
> + { _loc.file_with_nul() }
> +
> + #[cfg(not(CONFIG_RUSTC_HAS_FILE_WITH_NUL))]
> + { c"<Location::file_with_nul() not supported>" }
> +}
If a `let _` works, then it may be better -- please see a similar case at:
https://lore.kernel.org/rust-for-linux/CANiq72=ph_XG0TtkdsNJCUZMiAMYBo11eJaCTLCTpTAFXtcNMA@mail.gmail.com/
The new version looks great, thanks!
Cheers,
Miguel
Powered by blists - more mailing lists