Merge "Update code for Rust 1.82.0" into main am: dfcafbed46

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Virtualization/+/3390932

Change-Id: Ib363a2dfa1223b76b27a53c591499910be5d63ac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/libs/libvmbase/src/bionic.rs b/libs/libvmbase/src/bionic.rs
index 37b6e45..7b9fe2a 100644
--- a/libs/libvmbase/src/bionic.rs
+++ b/libs/libvmbase/src/bionic.rs
@@ -71,11 +71,10 @@
 pub static mut ERRNO: c_int = 0;
 
 #[no_mangle]
-#[allow(unused_unsafe)]
+// SAFETY: C functions which call this are only called from the main thread, not from exception
+// handlers.
 unsafe extern "C" fn __errno() -> *mut c_int {
-    // SAFETY: C functions which call this are only called from the main thread, not from exception
-    // handlers.
-    unsafe { addr_of_mut!(ERRNO) as *mut _ }
+    addr_of_mut!(ERRNO) as *mut _
 }
 
 fn set_errno(value: c_int) {
diff --git a/libs/libvmbase/src/layout.rs b/libs/libvmbase/src/layout.rs
index cf3a8fc..ad7a390 100644
--- a/libs/libvmbase/src/layout.rs
+++ b/libs/libvmbase/src/layout.rs
@@ -44,9 +44,7 @@
 #[macro_export]
 macro_rules! linker_addr {
     ($symbol:ident) => {{
-        // SAFETY: We're just getting the address of an extern static symbol provided by the linker,
-        // not dereferencing it.
-        let addr = unsafe { addr_of!($crate::linker::$symbol) as usize };
+        let addr = addr_of!($crate::linker::$symbol) as usize;
         VirtualAddress(addr)
     }};
 }