From cc6f8715574891625984ac8913ade80d1797d4ff Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Thu, 20 Feb 2025 10:28:28 -0700 Subject: [PATCH] Update toolchain to 1.85.0, edition to 2024 Signed-off-by: Tim Crawford --- Cargo.toml | 2 +- rust-toolchain.toml | 2 +- src/fde.rs | 8 ++++---- src/main.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 156dc0e..d0cd43e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "system76_firmware_setup" version = "1.0.0" -edition = "2021" +edition = "2024" license = "GPL-3.0-only" [profile.release] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 289d2e1..fea6f0e 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-05-11" +channel = "1.85.0" targets = ["x86_64-unknown-uefi"] profile = "minimal" diff --git a/src/fde.rs b/src/fde.rs index 1b07380..72f691d 100644 --- a/src/fde.rs +++ b/src/fde.rs @@ -120,12 +120,12 @@ impl ListEntry { unsafe fn object_at(&self, offset: usize) -> &T { let addr = self as *const Self as usize; - &*((addr - offset) as *const T) + unsafe { &*((addr - offset) as *const T) } } unsafe fn object_at_mut(&mut self, offset: usize) -> &mut T { let addr = self as *mut Self as usize; - &mut *((addr - offset) as *mut T) + unsafe { &mut *((addr - offset) as *mut T) } } } @@ -140,11 +140,11 @@ macro_rules! list_entry { ($t:ident, $l:tt) => { impl ListEntryObject<$t> for ListEntry<$t> { unsafe fn object(&self) -> &$t { - self.object_at(offset_of!($t, $l)) + unsafe { self.object_at(offset_of!($t, $l)) } } unsafe fn object_mut(&mut self) -> &mut $t { - self.object_at_mut(offset_of!($t, $l)) + unsafe { self.object_at_mut(offset_of!($t, $l)) } } } }; diff --git a/src/main.rs b/src/main.rs index 8e3abf6..d69baf1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,7 @@ mod rng; mod security; mod ui; -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn main() -> Status { let uefi = std::system_table();