File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ fn impl_struct(input: Struct) -> TokenStream {
197
197
let source_var = Ident :: new ( "source" , span) ;
198
198
let body = from_initializer ( from_field, backtrace_field, & source_var) ;
199
199
quote_spanned ! { span=>
200
- #[ allow( unused_qualifications) ]
200
+ #[ allow( unused_qualifications, clippy :: needless_lifetimes ) ]
201
201
#[ automatically_derived]
202
202
impl #impl_generics :: core:: convert:: From <#from> for #ty #ty_generics #where_clause {
203
203
#[ allow( deprecated) ]
@@ -462,7 +462,7 @@ fn impl_enum(input: Enum) -> TokenStream {
462
462
let source_var = Ident :: new ( "source" , span) ;
463
463
let body = from_initializer ( from_field, backtrace_field, & source_var) ;
464
464
Some ( quote_spanned ! { span=>
465
- #[ allow( unused_qualifications) ]
465
+ #[ allow( unused_qualifications, clippy :: needless_lifetimes ) ]
466
466
#[ automatically_derived]
467
467
impl #impl_generics :: core:: convert:: From <#from> for #ty #ty_generics #where_clause {
468
468
#[ allow( deprecated) ]
Original file line number Diff line number Diff line change @@ -18,3 +18,18 @@ fn test_unused_qualifications() {
18
18
19
19
let _: MyError ;
20
20
}
21
+
22
+ #[ test]
23
+ fn test_needless_lifetimes ( ) {
24
+ #![ allow( dead_code) ]
25
+ #![ deny( clippy:: needless_lifetimes) ]
26
+
27
+ #[ derive( Debug , Error ) ]
28
+ #[ error( "..." ) ]
29
+ pub enum MyError < ' a > {
30
+ A ( #[ from] std:: io:: Error ) ,
31
+ B ( & ' a ( ) ) ,
32
+ }
33
+
34
+ let _: MyError ;
35
+ }
You can’t perform that action at this time.
0 commit comments