2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:4:1
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
|
2020-03-16 11:44:24 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::needless-lifetimes` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:6:1
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {}
|
2020-03-16 11:44:24 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:16:1
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2020-03-16 11:44:24 +00:00
|
|
|
LL | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:45:1
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2020-03-16 11:44:24 +00:00
|
|
|
LL | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:50:1
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2020-03-16 11:44:24 +00:00
|
|
|
LL | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()>
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:62:1
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
|
2020-03-16 11:44:24 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2020-09-08 00:39:39 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
|
|
|
--> $DIR/needless_lifetimes.rs:86:1
|
|
|
|
|
|
|
|
|
LL | fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:120:5
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
2020-03-16 11:44:24 +00:00
|
|
|
LL | fn self_and_out<'s>(&'s self) -> &'s u8 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:129:5
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) {}
|
2020-03-16 11:44:24 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:148:1
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
2020-03-16 11:44:24 +00:00
|
|
|
LL | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:178:1
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
2020-03-16 11:44:24 +00:00
|
|
|
LL | fn trait_obj_elided2<'a>(_arg: &'a dyn Drop) -> &'a str {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:184:1
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
2020-03-16 11:44:24 +00:00
|
|
|
LL | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:203:1
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
2020-03-16 11:44:24 +00:00
|
|
|
LL | fn named_input_elided_output<'a>(_arg: &'a str) -> &str {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:211:1
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
2020-03-16 11:44:24 +00:00
|
|
|
LL | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-08 08:43:13 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
2019-05-20 17:19:49 +00:00
|
|
|
--> $DIR/needless_lifetimes.rs:247:1
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
2020-03-16 11:44:24 +00:00
|
|
|
LL | fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-10-08 08:43:13 +00:00
|
|
|
|
2019-09-01 06:11:40 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
|
|
|
--> $DIR/needless_lifetimes.rs:254:9
|
|
|
|
|
|
|
|
|
LL | fn needless_lt<'a>(x: &'a u8) {}
|
2020-03-16 11:44:24 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-09-01 06:11:40 +00:00
|
|
|
|
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
|
|
|
--> $DIR/needless_lifetimes.rs:258:9
|
|
|
|
|
|
|
|
|
LL | fn needless_lt<'a>(_x: &'a u8) {}
|
2020-03-16 11:44:24 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-09-01 06:11:40 +00:00
|
|
|
|
2020-09-08 20:22:23 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
|
|
|
--> $DIR/needless_lifetimes.rs:271:9
|
|
|
|
|
|
|
|
|
LL | fn baz<'a>(&'a self) -> impl Foo + 'a {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
|
|
|
--> $DIR/needless_lifetimes.rs:300:5
|
|
|
|
|
|
|
|
|
LL | fn impl_trait_elidable_nested_named_lifetimes<'a>(i: &'a i32, f: impl for<'b> Fn(&'b i32) -> &'b i32) -> &'a i32 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
|
|
|
--> $DIR/needless_lifetimes.rs:303:5
|
|
|
|
|
|
|
|
|
LL | fn impl_trait_elidable_nested_anonymous_lifetimes<'a>(i: &'a i32, f: impl Fn(&i32) -> &i32) -> &'a i32 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
|
|
|
--> $DIR/needless_lifetimes.rs:312:5
|
|
|
|
|
|
|
|
|
LL | fn generics_elidable<'a, T: Fn(&i32) -> &i32>(i: &'a i32, f: T) -> &'a i32 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
|
|
|
--> $DIR/needless_lifetimes.rs:324:5
|
|
|
|
|
|
|
|
|
LL | fn where_clause_elidadable<'a, T>(i: &'a i32, f: T) -> &'a i32
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-09-29 22:33:46 +00:00
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
|
|
|
--> $DIR/needless_lifetimes.rs:339:5
|
|
|
|
|
|
|
|
|
LL | fn pointer_fn_elidable<'a>(i: &'a i32, f: fn(&i32) -> &i32) -> &'a i32 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
|
|
|
--> $DIR/needless_lifetimes.rs:352:5
|
|
|
|
|
|
|
|
|
LL | fn nested_fn_pointer_3<'a>(_: &'a i32) -> fn(fn(&i32) -> &i32) -> i32 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
|
|
|
|
--> $DIR/needless_lifetimes.rs:355:5
|
|
|
|
|
|
|
|
|
LL | fn nested_fn_pointer_4<'a>(_: &'a i32) -> impl Fn(fn(&i32)) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 25 previous errors
|
2018-01-16 16:06:27 +00:00
|
|
|
|