blob: c9d5e7521df0a40243502152a92bee073ae76eb8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
From 223f8540e80c75730d95d925d6ab9e03cfbfa011 Mon Sep 17 00:00:00 2001
From: Tamir Duberstein <tamird@gmail.com>
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]
|