Skip to content

Commit

Permalink
fix compile error with rustc 1.77.0-nightly (62d7ed4a6 2024-01-11)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
wenhaozhao committed Jan 12, 2024
1 parent cced5d7 commit 41f948c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rustsbi-qemu/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ extern "C" fn rust_main(hartid: usize, opaque: usize) {
static mut ebss: u64;
}
unsafe {
let mut ptr = &mut sbss as *mut u64;
let end = &mut ebss as *mut u64;
let mut ptr = sbss as *mut u64;
let end = ebss as *mut u64;
while ptr < end {
ptr.write_volatile(0);
ptr = ptr.offset(1);
Expand Down

0 comments on commit 41f948c

Please sign in to comment.