Temporary workaround for Rust 1.82.0 update
The `addr_of!` and `addr_of_mut!` macros are no longer unsafe in 1.82.0,
but we need a way to silence this warning that is compatible with both
1.81 and 1.82. This change will silence the warning while we are
profiling and building 1.82 and we can replace it with the real fix
(aosp/3390932) once 1.82 has been deployed.
Test: m out/soong/.intermediates/packages/modules/Virtualization/libs/libvmbase/libvmbase/android_arm64_armv8-a_cortex-a53_rlib_rlib-std/libvmbase.rlib
Bug: 369422063
Change-Id: Ie70dcacb903ed621bfad983be3f934ad17482836
diff --git a/libs/libvmbase/src/bionic.rs b/libs/libvmbase/src/bionic.rs
index 8b40dae..3c0cd6f 100644
--- a/libs/libvmbase/src/bionic.rs
+++ b/libs/libvmbase/src/bionic.rs
@@ -72,6 +72,7 @@
pub static mut ERRNO: c_int = 0;
#[no_mangle]
+#[allow(unused_unsafe)]
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.
diff --git a/libs/libvmbase/src/layout.rs b/libs/libvmbase/src/layout.rs
index a8f7827..e7a645b 100644
--- a/libs/libvmbase/src/layout.rs
+++ b/libs/libvmbase/src/layout.rs
@@ -14,6 +14,8 @@
//! Memory layout.
+#![allow(unused_unsafe)]
+
pub mod crosvm;
use crate::linker::__stack_chk_guard;