rust: use the new name Location::file_as_c_str() in Rust >= 1.91.0
authorAlice Ryhl <aliceryhl@google.com>
Wed, 27 Aug 2025 13:12:16 +0000 (13:12 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 31 Aug 2025 21:34:34 +0000 (23:34 +0200)
commitc09461a0d24fba8a847a37a381626141da22d8ee
treefb4126dc654c9dfdfc88b00f454c7a018aa4844f
parent1b237f190eb3d36f52dffe07a40b5eb210280e00
rust: use the new name Location::file_as_c_str() in Rust >= 1.91.0

As part of the stabilization of Location::file_with_nul(), it was brought
up that the with_nul() suffix usually means something else in Rust APIs,
so the API is being renamed prior to stabilization [1].

Thus, use the new name on new rustc versions.

Link: https://www.github.com/rust-lang/rust/pull/145928
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://lore.kernel.org/r/20250827-file_as_c_str-v1-1-d3f5a3916a9c@google.com
[ Kept `cfg` separation. Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
init/Kconfig
rust/kernel/lib.rs