From be0bc8ca11d7da694e1ddcbb692cecf3def2e7d7 Mon Sep 17 00:00:00 2001 From: auronandace Date: Fri, 6 Feb 2026 21:05:29 +0000 Subject: [PATCH] add clippy lint ref_as_ptr --- Cargo.toml | 2 ++ src/ld_so/debug.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 64c4a9c4a5..820c43a6b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,10 +22,12 @@ exclude = ["tests", "dlmalloc-rs"] [workspace.lints.clippy] ptr_as_ptr = "warn" ptr_cast_constness = "warn" +ref_as_ptr = "warn" [lints.clippy] ptr_as_ptr = "warn" ptr_cast_constness = "warn" +ref_as_ptr = "warn" [build-dependencies] cc = "1" diff --git a/src/ld_so/debug.rs b/src/ld_so/debug.rs index 02b6530063..30f2c0549c 100644 --- a/src/ld_so/debug.rs +++ b/src/ld_so/debug.rs @@ -99,8 +99,8 @@ impl LinkMap { Box::into_raw(map) } fn link(&mut self, map: &mut LinkMap) { - map.l_prev = self as *mut LinkMap; - self.l_next = map as *mut LinkMap; + map.l_prev = ptr::from_mut::(self); + self.l_next = ptr::from_mut::(map); } fn new_with_args(l_addr: usize, name: &str, l_ld: usize) -> *mut Self { let map = LinkMap::new();