diff --git a/esp-hal/src/dma/buffers.rs b/esp-hal/src/dma/buffers.rs index 10a76bd03..1b343a742 100644 --- a/esp-hal/src/dma/buffers.rs +++ b/esp-hal/src/dma/buffers.rs @@ -923,8 +923,9 @@ unsafe impl DmaTxBuffer for EmptyBuf { type View = EmptyBuf; fn prepare(&mut self) -> Preparation { + #[allow(unused_unsafe)] // stable requires unsafe, nightly complains about it Preparation { - start: unsafe { EMPTY.as_mut_ptr() }, + start: unsafe { core::ptr::addr_of_mut!(EMPTY).cast() }, block_size: None, } } @@ -946,8 +947,9 @@ unsafe impl DmaRxBuffer for EmptyBuf { type View = EmptyBuf; fn prepare(&mut self) -> Preparation { + #[allow(unused_unsafe)] // stable requires unsafe, nightly complains about it Preparation { - start: unsafe { EMPTY.as_mut_ptr() }, + start: unsafe { core::ptr::addr_of_mut!(EMPTY).cast() }, block_size: None, } } diff --git a/esp-ieee802154/src/raw.rs b/esp-ieee802154/src/raw.rs index 806222b0d..8ce91686d 100644 --- a/esp-ieee802154/src/raw.rs +++ b/esp-ieee802154/src/raw.rs @@ -257,8 +257,9 @@ fn stop_current_operation() { } fn set_next_rx_buffer() { + #[allow(unused_unsafe)] // stable compiler needs unsafe, nightly complains about it unsafe { - set_rx_addr(RX_BUFFER.as_mut_ptr()); + set_rx_addr(core::ptr::addr_of_mut!(RX_BUFFER).cast()); } }