From 9d07e3f4c0da6aac9fb3e0f98cdad93e63118345 Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Fri, 18 Oct 2024 19:54:42 +0000 Subject: [PATCH] Fix or disable some lints --- cortex-m-rt/src/lib.rs | 5 ++++- cortex-m-semihosting/src/export.rs | 4 ++++ cortex-m/src/itm.rs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs index 615c96c2..c1145b3a 100644 --- a/cortex-m-rt/src/lib.rs +++ b/cortex-m-rt/src/lib.rs @@ -1079,7 +1079,10 @@ pub fn heap_start() -> *mut u32 { static mut __sheap: u32; } - unsafe { core::ptr::addr_of_mut!(__sheap) } + #[allow(unused_unsafe)] // no longer unsafe since rust 1.82.0 + unsafe { + core::ptr::addr_of_mut!(__sheap) + } } // Entry point is Reset. diff --git a/cortex-m-semihosting/src/export.rs b/cortex-m-semihosting/src/export.rs index 46e70e79..03604bf0 100644 --- a/cortex-m-semihosting/src/export.rs +++ b/cortex-m-semihosting/src/export.rs @@ -1,5 +1,9 @@ //! IMPLEMENTATION DETAILS USED BY MACROS +// This must be replaced by a different solution before rust edition 2024 +// https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html +#![allow(static_mut_refs)] + use core::fmt::{self, Write}; use crate::hio::{self, HostStream}; diff --git a/cortex-m/src/itm.rs b/cortex-m/src/itm.rs index 72cb0d9a..905aefb8 100644 --- a/cortex-m/src/itm.rs +++ b/cortex-m/src/itm.rs @@ -57,7 +57,7 @@ unsafe fn write_aligned_impl(port: &mut Stim, buffer: &[u8]) { struct Port<'p>(&'p mut Stim); -impl<'p> fmt::Write for Port<'p> { +impl fmt::Write for Port<'_> { #[inline] fn write_str(&mut self, s: &str) -> fmt::Result { write_all(self.0, s.as_bytes());