gentoo/dev-util/bpf-linker/files/bpf-linker-0.9.14-rust-1.88.patch
Michał Górny 8007493aba
dev-util/bpf-linker: Fix building with rust 1.88.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2025-09-11 15:09:27 +02:00

40 lines
1.4 KiB
Diff

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]