diff --git a/src/lib.rs b/src/lib.rs index c06448c6..4bb1a66a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,9 +60,7 @@ macro_rules! kernel_module { #[link_section = ".modinfo"] #[allow(non_upper_case_globals)] // TODO: Generate a name the same way the kernel's `__MODULE_INFO` does. - // TODO: This needs to be a `&'static [u8]`, since the kernel defines this as a - // `const char []`. - pub static $name: &'static str = concat!(stringify!($name), "=", $value); + pub static $name: &'static [u8] = concat!(stringify!($name), "=", $value, '\0').as_bytes(); }; } diff --git a/tests/sysctl/src/lib.rs b/tests/sysctl/src/lib.rs index 45fbc871..84e9a052 100644 --- a/tests/sysctl/src/lib.rs +++ b/tests/sysctl/src/lib.rs @@ -1,4 +1,5 @@ #![no_std] +#![feature(const_str_as_bytes)] use core::sync::atomic::AtomicBool;