Skip to content

Commit

Permalink
Merge pull request #55 from wenhaozhao/fix-mutable-reference-of-mutab…
Browse files Browse the repository at this point in the history
…le-static-error

fix compile error with rustc 1.77.0-nightly (62d7ed4a6 2024-01-11)
  • Loading branch information
luojia65 authored Jan 22, 2024
2 parents cced5d7 + adaf6df commit 2ea3bab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bench-kernel/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ extern "C" fn rust_main(hartid: usize, _dtb_pa: 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
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
4 changes: 2 additions & 2 deletions test-kernel/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ extern "C" fn rust_main(hartid: usize, dtb_pa: 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 2ea3bab

Please sign in to comment.