Skip to contentSkip to conversation

FAILED: patch "[PATCH] rust: allow Rust 1.87.0's `clippy::ptr_eq` lint" failed to apply to 6.14-stable tree

PATCH In review [email protected] 3 participants 3 messages May 12, 2025

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.14.y
git checkout FETCH_HEAD
git cherry-pick -x a39f3087092716f2bd531d6fdc20403c3dc2a879
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025051210-devourer-antarctic-1ed3@gregkh' --subject-prefix 'PATCH 6.14.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From a39f3087092716f2bd531d6fdc20403c3dc2a879 Mon Sep 17 00:00:00 2001
From: Miguel Ojeda <[email protected]>
Date: Fri, 2 May 2025 16:02:34 +0200
Subject: [PATCH] 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).
[ Converted to `allow`s since backport was confirmed. - Miguel ]
rust/kernel/alloc/kvec.rs +3 -0
index ae9d072741ce..87a71fd40c3c 100644
@@ -2,6 +2,9 @@
 
 //! 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,
rust/kernel/list.rs +3 -0
index a335c3b1ff5e..2054682c5724 100644
@@ -4,6 +4,9 @@
 
 //! 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};
maintainer
#1 lore raw

PATCH 1/1 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).
[ Converted to `allow`s since backport was confirmed. - Miguel ]
(cherry picked from commit a39f3087092716f2bd531d6fdc20403c3dc2a879)
---
 rust/kernel/alloc/kvec.rs | 3 +++
 rust/kernel/list.rs       | 3 +++
 2 files changed, 6 insertions(+)
rust/kernel/alloc/kvec.rs +3 -0
index ae9d072741ce..87a71fd40c3c 100644
@@ -2,6 +2,9 @@
 
 //! 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,
rust/kernel/list.rs +3 -0
index fb93330f4af4..3841ba02ef7a 100644
@@ -4,6 +4,9 @@
 
 //! A linked list implementation.
 
+// May not be needed in Rust 1.87.0 (pending beta backport).
+#![allow(clippy::ptr_eq)]
+
 use crate::init::PinInit;
 use crate::sync::ArcBorrow;
 use crate::types::Opaque;
Signature · 1 line
2.49.0
maintainer
#2 lore raw

Re: [PATCH 6.14.y] rust: allow Rust 1.87.0's `clippy::ptr_eq` lint

[ Sasha's backport helper bot ]

Hi,

Summary of potential issues:
⚠️ Found matching upstream commit but patch is missing proper reference to it

Found matching upstream commit: a39f3087092716f2bd531d6fdc20403c3dc2a879

Note: The patch differs from the upstream commit:
---
1: a39f308709271 ! 1: f5e8bab8b025c rust: allow Rust 1.87.0's clippy::ptr_eq lint
@@ Commit message

[ Converted to `allow`s since backport was confirmed. - Miguel ]

+ (cherry picked from commit a39f3087092716f2bd531d6fdc20403c3dc2a879)
+ Signed-off-by: Miguel Ojeda <[email protected]>

## rust/kernel/alloc/kvec.rs ##
@@
@@ rust/kernel/list.rs
+// May not be needed in Rust 1.87.0 (pending beta backport). +#![allow(clippy::ptr_eq)]
+
+ use crate::init::PinInit;
use crate::sync::ArcBorrow;
use crate::types::Opaque;
- use core::iter::{DoubleEndedIterator, FusedIterator};
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.14.y       |  Success    |  Success   |