]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rust: remove unneeded Rust 1.87.0 `allow(clippy::ptr_eq)`
authorMiguel Ojeda <ojeda@kernel.org>
Tue, 20 May 2025 18:21:25 +0000 (20:21 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Thu, 22 May 2025 09:46:50 +0000 (11:46 +0200)
For the Rust 1.87.0 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)]`

However, a backport to relax a bit the `clippy::ptr_eq` finally landed,
and thus Clippy did not warn by the time the release happened.

Thus remove the `allow`s 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
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250520182125.806758-1-ojeda@kernel.org
[ Reworded for clarity. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/alloc/kvec.rs
rust/kernel/list.rs

index d9f5b79b26dcb6d8631301c5665fef9591e4f492..1a0dd852a468ccda6ea1b521bc1e7dbc8d7fc79c 100644 (file)
@@ -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,
index 2054682c5724ce4d7fd1aed039bf838c9a2be2e2..a335c3b1ff5e48c246d3a771a2c3c750a4138419 100644 (file)
@@ -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};