Update needed for Rust v1.77.1
Bug: http://b/330185853
Test: ./test_compiler.py --prebuilt-path dist/rust-dev.tar.xz --target aosp_cf_x86_64_phone --image
Change-Id: Id56721d7857abd538d942d0d42255f9a6ee2923f
diff --git a/vmbase/src/bionic.rs b/vmbase/src/bionic.rs
index a049616..63a6894 100644
--- a/vmbase/src/bionic.rs
+++ b/vmbase/src/bionic.rs
@@ -14,17 +14,17 @@
//! Low-level compatibility layer between baremetal Rust and Bionic C functions.
-use core::ffi::c_char;
-use core::ffi::c_int;
-use core::ffi::c_void;
-use core::ffi::CStr;
-use core::slice;
-use core::str;
-
use crate::console;
use crate::eprintln;
use crate::rand::fill_with_entropy;
use crate::read_sysreg;
+use core::ffi::c_char;
+use core::ffi::c_int;
+use core::ffi::c_void;
+use core::ffi::CStr;
+use core::ptr::addr_of_mut;
+use core::slice;
+use core::str;
use cstr::cstr;
@@ -75,7 +75,7 @@
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 { &mut ERRNO as *mut _ }
+ unsafe { addr_of_mut!(ERRNO) as *mut _ }
}
fn set_errno(value: c_int) {