Skip to content

Commit 2415d84

Browse files
committed
rust: added extern crate self as kernel
This allows proc macros to refer to `::kernel`. This syntax is needed in order to ensure that we refer to the true kernel crate instead of a local module. Signed-off-by: Benno Lossin <[email protected]>
1 parent f475a1e commit 2415d84

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rust/kernel/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#[cfg(not(CONFIG_RUST))]
3232
compile_error!("Missing kernel configuration for conditional compilation");
3333

34+
// allow proc-macros to refer to `::kernel`.
35+
extern crate self as kernel;
36+
3437
#[cfg(not(test))]
3538
#[cfg(not(testlib))]
3639
mod allocator;

0 commit comments

Comments
 (0)