rust: use absolute paths in macros referencing core and kernel
authorIgor Korotin <igor.korotin.linux@gmail.com>
Mon, 19 May 2025 16:45:53 +0000 (17:45 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Thu, 22 May 2025 22:12:14 +0000 (00:12 +0200)
commitde7cd3e4d6387df6a5ae8c4c32ff0479ebe0efb5
tree75379535683cabe9d3839d4886192d549851da75
parent977c4308ee4270cf46e2c66b37de8e04670daa0c
rust: use absolute paths in macros referencing core and kernel

Macros and auto-generated code should use absolute paths, `::core::...`
and `::kernel::...`, for core and kernel references.

This prevents issues where user-defined modules named `core` or `kernel`
could be picked up instead of the `core` or `kernel` crates.

Thus clean some references up.

Suggested-by: Benno Lossin <benno.lossin@proton.me>
Closes: https://github.com/Rust-for-Linux/linux/issues/1150
Signed-off-by: Igor Korotin <igor.korotin.linux@gmail.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250519164615.3310844-1-igor.korotin.linux@gmail.com
[ Applied `rustfmt`. Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/ffi.rs
rust/kernel/device.rs
rust/kernel/device_id.rs
rust/kernel/kunit.rs
rust/kernel/static_assert.rs
rust/kernel/str.rs
rust/macros/kunit.rs
rust/macros/lib.rs
rust/macros/module.rs
scripts/rustdoc_test_builder.rs
scripts/rustdoc_test_gen.rs