Skip to content

Commit 9f27b76

Browse files
committed
Ignore elidable_lifetime_names pedantic clippy lint
warning: the following explicit lifetimes could be elided: 'a --> src/var.rs:5:6 | 5 | impl<'a, T: Pointer + ?Sized> Pointer for Var<'a, T> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]` help: elide the lifetimes | 5 - impl<'a, T: Pointer + ?Sized> Pointer for Var<'a, T> { 5 + impl<T: Pointer + ?Sized> Pointer for Var<'_, T> { | warning: the following explicit lifetimes could be elided: 'a --> tests/test_lints.rs:40:22 | 40 | pub enum MyError<'a> { | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]` help: elide the lifetimes | 40 - pub enum MyError<'a> { 40 + pub enum MyError'_> { | warning: the following explicit lifetimes could be elided: 'a --> tests/test_display.rs:157:14 | 157 | impl<'a> Display for Msg<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]` help: elide the lifetimes | 157 - impl<'a> Display for Msg<'a> { 157 + impl Display for Msg<'_> { |
1 parent daf2a6f commit 9f27b76

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

impl/src/expand.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,12 @@ fn impl_struct(input: Struct) -> TokenStream {
181181
}
182182
};
183183
Some(quote! {
184-
#[allow(deprecated, unused_qualifications, clippy::needless_lifetimes)]
184+
#[allow(
185+
deprecated,
186+
unused_qualifications,
187+
clippy::elidable_lifetime_names,
188+
clippy::needless_lifetimes,
189+
)]
185190
#from_impl
186191
})
187192
});
@@ -451,7 +456,12 @@ fn impl_enum(input: Enum) -> TokenStream {
451456
}
452457
};
453458
Some(quote! {
454-
#[allow(deprecated, unused_qualifications, clippy::needless_lifetimes)]
459+
#[allow(
460+
deprecated,
461+
unused_qualifications,
462+
clippy::elidable_lifetime_names,
463+
clippy::needless_lifetimes,
464+
)]
455465
#from_impl
456466
})
457467
});

src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@
259259
#![no_std]
260260
#![doc(html_root_url = "https://docs.rs/thiserror/2.0.11")]
261261
#![allow(
262+
clippy::elidable_lifetime_names,
262263
clippy::module_name_repetitions,
263264
clippy::needless_lifetimes,
264265
clippy::return_self_not_must_use,

tests/test_display.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![allow(
2+
clippy::elidable_lifetime_names,
23
clippy::needless_lifetimes,
34
clippy::needless_raw_string_hashes,
45
clippy::trivially_copy_pass_by_ref,

tests/test_lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fn test_unused_qualifications() {
3333
#[test]
3434
fn test_needless_lifetimes() {
3535
#![allow(dead_code)]
36-
#![deny(clippy::needless_lifetimes)]
36+
#![deny(clippy::elidable_lifetime_names, clippy::needless_lifetimes)]
3737

3838
#[derive(Error, Debug)]
3939
#[error("...")]

0 commit comments

Comments
 (0)