Skip to content

Commit 96b2ab1

Browse files
committed
rust: allow Rust 1.87.0's clippy::ptr_eq lint
Starting with Rust 1.87.0 (expected 2025-05-15) [1], Clippy may expand the `ptr_eq` lint, e.g.: 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)]` It is expected that a PR to relax the lint will be backported [2] by the time Rust 1.87.0 releases, since the lint was considered too eager (at least by default) [3]. Thus allow the lint temporarily just in case. Cc: [email protected] # Needed in 6.12.y and later (Rust is pinned in older LTSs). Link: rust-lang/rust-clippy#14339 [1] Link: rust-lang/rust-clippy#14526 [2] Link: rust-lang/rust-clippy#14525 [3] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 19f5ca4 commit 96b2ab1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

rust/kernel/alloc/kvec.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
//! Implementation of [`Vec`].
44
5+
// May not be needed in Rust 1.87.0 (pending beta backport).
6+
#![allow(clippy::ptr_eq)]
7+
58
use super::{
69
allocator::{KVmalloc, Kmalloc, Vmalloc},
710
layout::ArrayLayout,

rust/kernel/list.rs

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
//! A linked list implementation.
66
7+
// May not be needed in Rust 1.87.0 (pending beta backport).
8+
#![allow(clippy::ptr_eq)]
9+
710
use crate::sync::ArcBorrow;
811
use crate::types::Opaque;
912
use core::iter::{DoubleEndedIterator, FusedIterator};

0 commit comments

Comments
 (0)