Skip to content

Commit 02effee

Browse files
committed
Appease invalid_null_arguments
This was promoted from a clippy lint in nightly. Link: rust-lang/rust#119220
1 parent 022dbba commit 02effee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/assembly/auxiliary/dep-exports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
pub fn dep_public_symbol() -> u8 {
66
// read_volatile stops LTO inlining the function in the calling crate
7-
unsafe { core::ptr::read_volatile(0 as *const u8) }
7+
unsafe { core::ptr::read_volatile(core::ptr::dangling()) }
88
}
99

1010
#[no_mangle]

tests/btf/assembly/auxiliary/dep-exports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#[inline(never)]
66
pub fn dep_public_symbol() -> u8 {
77
// read_volatile stops LTO inlining the function in the calling crate
8-
unsafe { core::ptr::read_volatile(0 as *const u8) }
8+
unsafe { core::ptr::read_volatile(core::ptr::dangling()) }
99
}
1010

1111
#[no_mangle]

0 commit comments

Comments
 (0)