Patch "rust: allow `clippy::needless_lifetimes`" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    rust: allow `clippy::needless_lifetimes`

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rust-allow-clippy-needless_lifetimes.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b64fdc48b7eaeece3ef525bb3e950b314f93dcd6
Author: Miguel Ojeda <ojeda@xxxxxxxxxx>
Date:   Sat Nov 16 19:15:37 2024 +0100

    rust: allow `clippy::needless_lifetimes`
    
    [ Upstream commit 60fc1e6750133620e404d40b93df5afe32e3e6c6 ]
    
    In beta Clippy (i.e. Rust 1.83.0), the `needless_lifetimes` lint has
    been extended [1] to suggest eliding `impl` lifetimes, e.g.
    
        error: the following explicit lifetimes could be elided: 'a
        --> rust/kernel/list.rs:647:6
            |
        647 | impl<'a, T: ?Sized + ListItem<ID>, const ID: u64> FusedIterator for Iter<'a, T, ID> {}
            |      ^^                                                                  ^^
            |
            = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
            = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
            = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`
        help: elide the lifetimes
            |
        647 - impl<'a, T: ?Sized + ListItem<ID>, const ID: u64> FusedIterator for Iter<'a, T, ID> {}
        647 + impl<T: ?Sized + ListItem<ID>, const ID: u64> FusedIterator for Iter<'_, T, ID> {}
    
    A possibility would have been to clean them -- the RFC patch [2] did
    this, while asking if we wanted these cleanups. There is an open issue
    [3] in Clippy about being able to differentiate some of the new cases,
    e.g. those that do not involve introducing `'_`. Thus it seems others
    feel similarly.
    
    Thus, for the time being, we decided to `allow` the lint.
    
    Link: https://github.com/rust-lang/rust-clippy/pull/13286 [1]
    Link: https://lore.kernel.org/rust-for-linux/20241012231300.397010-1-ojeda@xxxxxxxxxx/ [2]
    Link: https://github.com/rust-lang/rust-clippy/issues/13514 [3]
    Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
    Reviewed-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20241116181538.369355-1-ojeda@xxxxxxxxxx
    Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/Makefile b/Makefile
index 0be58613bfe0..31b4fc9f5ccb 100644
--- a/Makefile
+++ b/Makefile
@@ -469,6 +469,7 @@ export rust_common_flags := --edition=2021 \
 			    -Wclippy::let_unit_value -Wclippy::mut_mut \
 			    -Wclippy::needless_bitwise_bool \
 			    -Wclippy::needless_continue \
+			    -Aclippy::needless_lifetimes \
 			    -Wclippy::no_mangle_with_rust_abi \
 			    -Wclippy::dbg_macro
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux