From 8b031b9b8e126dc60c2197ed00536bffcd12760e Mon Sep 17 00:00:00 2001 From: Burkhard Mittelbach Date: Fri, 13 Oct 2023 10:11:00 +0200 Subject: [PATCH] ?Sized support for VirtAddr::from_ptr --- src/addr.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/addr.rs b/src/addr.rs index a78cd4df..68d86f72 100644 --- a/src/addr.rs +++ b/src/addr.rs @@ -129,14 +129,8 @@ impl VirtAddr { // doesn't truncate. #[cfg(any(target_pointer_width = "32", target_pointer_width = "64"))] #[inline] - pub fn from_ptr(ptr: *const T) -> Self { - Self::new(ptr as u64) - } - - /// Creates a virtual address from the given slice. - #[cfg(target_pointer_width = "64")] - pub fn from_slice(slice: &[T]) -> Self { - Self::new(slice as *const [T] as *const T as u64) + pub fn from_ptr(ptr: *const T) -> Self { + Self::new(ptr as *const () as u64) } /// Converts the address to a raw pointer.