From 056f1f339c804dc05504d0789c78b87690977e0d Mon Sep 17 00:00:00 2001 From: Alex Martens Date: Wed, 10 Jan 2024 20:49:40 -0800 Subject: [PATCH] Fix nightly CI failures --- cortex-m-rt/examples/alignment.rs | 12 ++++++------ cortex-m-rt/src/lib.rs | 2 +- panic-itm/src/lib.rs | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cortex-m-rt/examples/alignment.rs b/cortex-m-rt/examples/alignment.rs index 4421e690..98142635 100644 --- a/cortex-m-rt/examples/alignment.rs +++ b/cortex-m-rt/examples/alignment.rs @@ -21,12 +21,12 @@ static RODATA2: &[u8; 2] = b"34"; #[entry] fn main() -> ! { unsafe { - let _bss1 = ptr::read_volatile(&BSS1); - let _bss2 = ptr::read_volatile(&BSS2); - let _data1 = ptr::read_volatile(&DATA1); - let _data2 = ptr::read_volatile(&DATA2); - let _rodata1 = ptr::read_volatile(&RODATA1); - let _rodata2 = ptr::read_volatile(&RODATA2); + let _bss1 = ptr::read_volatile(ptr::addr_of!(BSS1)); + let _bss2 = ptr::read_volatile(ptr::addr_of!(BSS2)); + let _data1 = ptr::read_volatile(ptr::addr_of!(DATA1)); + let _data2 = ptr::read_volatile(ptr::addr_of!(DATA2)); + let _rodata1 = ptr::read_volatile(ptr::addr_of!(RODATA1)); + let _rodata2 = ptr::read_volatile(ptr::addr_of!(RODATA2)); } loop {} diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs index 27bb1bdc..3ab4297c 100644 --- a/cortex-m-rt/src/lib.rs +++ b/cortex-m-rt/src/lib.rs @@ -1038,7 +1038,7 @@ pub fn heap_start() -> *mut u32 { static mut __sheap: u32; } - unsafe { &mut __sheap } + unsafe { core::ptr::addr_of_mut!(__sheap) } } // Entry point is Reset. diff --git a/panic-itm/src/lib.rs b/panic-itm/src/lib.rs index 5d969b00..b11880ad 100644 --- a/panic-itm/src/lib.rs +++ b/panic-itm/src/lib.rs @@ -43,6 +43,7 @@ use cortex_m::iprintln; use cortex_m::peripheral::ITM; #[panic_handler] +#[cfg(all(not(test), not(doctest)))] fn panic(info: &PanicInfo) -> ! { interrupt::disable();