From 9a7b9608513e36548572a060ee7cbfcb3a5fabb0 Mon Sep 17 00:00:00 2001 From: Graham MacDonald Date: Tue, 11 Jun 2024 20:29:28 +0100 Subject: [PATCH] latest rust changes Signed-off-by: Graham MacDonald --- aarch64/src/vmalloc.rs | 4 ++-- port/src/vmem.rs | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/aarch64/src/vmalloc.rs b/aarch64/src/vmalloc.rs index e6d0173..2e89d47 100644 --- a/aarch64/src/vmalloc.rs +++ b/aarch64/src/vmalloc.rs @@ -1,4 +1,4 @@ -use core::mem::MaybeUninit; +use core::{mem::MaybeUninit, ptr::addr_of}; use port::{ mcslock::{Lock, LockNode}, @@ -18,7 +18,7 @@ impl VmAlloc { fn new(heap_range: VirtRange) -> Self { let quantum = 4096; - let early_tags_ptr = unsafe { &EARLY_TAGS_PAGE as *const _ as usize }; + let early_tags_ptr = unsafe { addr_of!(EARLY_TAGS_PAGE) as usize }; let early_tags_size = unsafe { EARLY_TAGS_PAGE.len() }; let early_tags_range = VirtRange::with_len(early_tags_ptr, early_tags_size); diff --git a/port/src/vmem.rs b/port/src/vmem.rs index c2e61ec..dba4bdd 100644 --- a/port/src/vmem.rs +++ b/port/src/vmem.rs @@ -554,7 +554,6 @@ impl Arena { #[cfg(test)] mod tests { - use core::mem::size_of; use super::*;