From f93efa73a9b25f7e0f695069452a6baea0290a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Wed, 9 Oct 2024 16:53:32 +0200 Subject: [PATCH] Clean up warnings (#2317) --- esp-hal/src/dma/buffers.rs | 6 ++++-- esp-ieee802154/src/raw.rs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) 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()); } }