From 223f8540e80c75730d95d925d6ab9e03cfbfa011 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 1 Apr 2025 10:19:23 -0400 Subject: [PATCH] Appease `invalid_null_arguments` This was promoted from a clippy lint in nightly. Link: https://github.com/rust-lang/rust/pull/119220 --- tests/assembly/auxiliary/dep-exports.rs | 2 +- tests/btf/assembly/auxiliary/dep-exports.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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]