Skip to content

Commit 41f948c

Browse files
author
wenhaozhao
committed
fix 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 cced5d7 commit 41f948c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rustsbi-qemu/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ extern "C" fn rust_main(hartid: usize, opaque: usize) {
7272
static mut ebss: u64;
7373
}
7474
unsafe {
75-
let mut ptr = &mut sbss as *mut u64;
76-
let end = &mut ebss as *mut u64;
75+
let mut ptr = sbss as *mut u64;
76+
let end = ebss as *mut u64;
7777
while ptr < end {
7878
ptr.write_volatile(0);
7979
ptr = ptr.offset(1);

0 commit comments

Comments
 (0)