mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-01 00:49:30 +00:00
6a8b20230b
Also adds a test for #5787
19 lines
554 B
Text
19 lines
554 B
Text
error: the following explicit lifetimes could be elided: 'a
|
|
--> $DIR/needless_lifetimes_impl_trait.rs:15:5
|
|
|
|
|
LL | fn baz<'a>(&'a self) -> impl Foo + 'a {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: the lint level is defined here
|
|
--> $DIR/needless_lifetimes_impl_trait.rs:1:9
|
|
|
|
|
LL | #![deny(clippy::needless_lifetimes)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
help: elide the lifetimes
|
|
|
|
|
LL - fn baz<'a>(&'a self) -> impl Foo + 'a {
|
|
LL + fn baz(&self) -> impl Foo + '_ {
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|