diff --git a/tests/assembly/auxiliary/dep-exports.rs b/tests/assembly/auxiliary/dep-exports.rs index 35e003cf..a3dcd682 100644 --- a/tests/assembly/auxiliary/dep-exports.rs +++ b/tests/assembly/auxiliary/dep-exports.rs @@ -4,7 +4,7 @@ pub fn dep_public_symbol() -> u8 { // read_volatile stops LTO inlining the function in the calling crate - unsafe { core::ptr::read_volatile(0 as *const u8) } + unsafe { core::ptr::read_volatile(core::ptr::dangling()) } } #[no_mangle] diff --git a/tests/btf/assembly/auxiliary/dep-exports.rs b/tests/btf/assembly/auxiliary/dep-exports.rs index 6adcdc03..3a95ecde 100644 --- a/tests/btf/assembly/auxiliary/dep-exports.rs +++ b/tests/btf/assembly/auxiliary/dep-exports.rs @@ -5,7 +5,7 @@ #[inline(never)] pub fn dep_public_symbol() -> u8 { // read_volatile stops LTO inlining the function in the calling crate - unsafe { core::ptr::read_volatile(0 as *const u8) } + unsafe { core::ptr::read_volatile(core::ptr::dangling()) } } #[no_mangle]