Skip to content

Commit 9b81037

Browse files
author
wenhaozhao
committed
fix test module compile error with rustc 1.77.0-nightly (62d7ed4a6 2024-01-11)
mutable reference of mutable static is discouraged for more information, see issue #114447 <rust-lang/rust#114447> reference of mutable static is a hard error from 2024 edition
1 parent 41f948c commit 9b81037

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test-kernel/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ extern "C" fn rust_main(hartid: usize, dtb_pa: usize) -> ! {
4040
static mut ebss: u64;
4141
}
4242
unsafe {
43-
let mut ptr = &mut sbss as *mut u64;
44-
let end = &mut ebss as *mut u64;
43+
let mut ptr = sbss as *mut u64;
44+
let end = ebss as *mut u64;
4545
while ptr < end {
4646
ptr.write_volatile(0);
4747
ptr = ptr.offset(1);

0 commit comments

Comments
 (0)