Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH] rust: remove unneeded Rust 1.87.0 `allow(clippy::ptr_eq)`
@ 2025-05-20 18:21 Miguel Ojeda
  2025-05-20 21:13 ` Alice Ryhl
  2025-05-22  9:47 ` Miguel Ojeda
  0 siblings, 2 replies; 4+ messages in thread
From: Miguel Ojeda @ 2025-05-20 18:21 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Danilo Krummrich
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, rust-for-linux,
	linux-kernel, patches

Before a change to relax the lint was backported to Rust 1.87.0 before
its release, Clippy was expected to warn with:

    error: use `core::ptr::eq` when comparing raw pointers
       --> rust/kernel/list.rs:438:12
        |
    438 |         if self.first == item {
        |            ^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::eq(self.first, item)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq
        = note: `-D clippy::ptr-eq` implied by `-D warnings`
        = help: to override `-D warnings` add `#[allow(clippy::ptr_eq)]`

The backported finally landed indeed, thus remove the `allow`s we added
back then, which were added just in case the backport did not land
in time.

See commit a39f30870927 ("rust: allow Rust 1.87.0's `clippy::ptr_eq`
lint") for details.

Link: https://github.com/rust-lang/rust/pull/140859 [1]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 rust/kernel/alloc/kvec.rs | 3 ---
 rust/kernel/list.rs       | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/rust/kernel/alloc/kvec.rs b/rust/kernel/alloc/kvec.rs
index 87a71fd40c3c..ae9d072741ce 100644
--- a/rust/kernel/alloc/kvec.rs
+++ b/rust/kernel/alloc/kvec.rs
@@ -2,9 +2,6 @@
 
 //! Implementation of [`Vec`].
 
-// May not be needed in Rust 1.87.0 (pending beta backport).
-#![allow(clippy::ptr_eq)]
-
 use super::{
     allocator::{KVmalloc, Kmalloc, Vmalloc},
     layout::ArrayLayout,
diff --git a/rust/kernel/list.rs b/rust/kernel/list.rs
index 2054682c5724..a335c3b1ff5e 100644
--- a/rust/kernel/list.rs
+++ b/rust/kernel/list.rs
@@ -4,9 +4,6 @@
 
 //! A linked list implementation.
 
-// May not be needed in Rust 1.87.0 (pending beta backport).
-#![allow(clippy::ptr_eq)]
-
 use crate::sync::ArcBorrow;
 use crate::types::Opaque;
 use core::iter::{DoubleEndedIterator, FusedIterator};

base-commit: a5806cd506af5a7c19bcd596e4708b5c464bfd21
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-22  9:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-20 18:21 [PATCH] rust: remove unneeded Rust 1.87.0 `allow(clippy::ptr_eq)` Miguel Ojeda
2025-05-20 21:13 ` Alice Ryhl
2025-05-20 21:15   ` Miguel Ojeda
2025-05-22  9:47 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox