From b8a555a5ddc799b7762d59dc5d5926017eba5114 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 6 Oct 2024 13:08:46 -0700 Subject: [PATCH] Ignore needless_lifetimes clippy lint warning: the following explicit lifetimes could be elided: 'a --> src/expand.rs:443:10 | 443 | impl<'a> VisitMut for AssociatedTypeImplTraits<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `-W clippy::needless-lifetimes` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_lifetimes)]` help: elide the lifetimes | 443 - impl<'a> VisitMut for AssociatedTypeImplTraits<'a> { 443 + impl VisitMut for AssociatedTypeImplTraits<'_> { | warning: the following explicit lifetimes could be elided: 'a --> tests/test.rs:453:10 | 453 | impl<'a> Trait2 for &'a () { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `-W clippy::needless-lifetimes` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_lifetimes)]` help: elide the lifetimes | 453 - impl<'a> Trait2 for &'a () { 453 + impl Trait2 for &() { | warning: the following explicit lifetimes could be elided: 'a --> tests/test.rs:1431:10 | 1431 | impl<'a> Drop for IncrementOnDrop<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 1431 - impl<'a> Drop for IncrementOnDrop<'a> { 1431 + impl Drop for IncrementOnDrop<'_> { | --- src/lib.rs | 1 + tests/test.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 17eb9ac..41a7f88 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -325,6 +325,7 @@ clippy::items_after_statements, clippy::match_like_matches_macro, clippy::module_name_repetitions, + clippy::needless_lifetimes, clippy::shadow_unrelated, clippy::similar_names, clippy::too_many_lines, diff --git a/tests/test.rs b/tests/test.rs index 6fd324d..7fd5e83 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -9,6 +9,7 @@ clippy::let_unit_value, clippy::missing_panics_doc, clippy::missing_safety_doc, + clippy::needless_lifetimes, clippy::needless_return, clippy::non_minimal_cfg, clippy::trivially_copy_pass_by_ref,