|
1 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 1 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
2 | 2 | --> $DIR/lifetimes.rs:17:1
|
3 | 3 | |
|
4 | 4 | 17 | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) { }
|
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
6 | 6 | |
|
7 | 7 | = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
|
8 | 8 |
|
9 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 9 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
10 | 10 | --> $DIR/lifetimes.rs:19:1
|
11 | 11 | |
|
12 | 12 | 19 | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) { }
|
13 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
14 | 14 |
|
15 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 15 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
16 | 16 | --> $DIR/lifetimes.rs:27:1
|
17 | 17 | |
|
18 | 18 | 27 | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 { x }
|
19 | 19 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
20 | 20 |
|
21 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 21 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
22 | 22 | --> $DIR/lifetimes.rs:39:1
|
23 | 23 | |
|
24 | 24 | 39 | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> { Ok(x) }
|
25 | 25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
26 | 26 |
|
27 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 27 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
28 | 28 | --> $DIR/lifetimes.rs:42:1
|
29 | 29 | |
|
30 | 30 | 42 | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> where T: Copy { Ok(x) }
|
31 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
32 | 32 |
|
33 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 33 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
34 | 34 | --> $DIR/lifetimes.rs:48:1
|
35 | 35 | |
|
36 | 36 | 48 | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) { }
|
37 | 37 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
38 | 38 |
|
39 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 39 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
40 | 40 | --> $DIR/lifetimes.rs:62:1
|
41 | 41 | |
|
42 | 42 | 62 | / fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
|
43 | 43 | 63 | | where for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>
|
44 | 44 | 64 | | { unreachable!() }
|
45 | 45 | | |__________________^
|
46 | 46 |
|
47 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 47 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
48 | 48 | --> $DIR/lifetimes.rs:87:5
|
49 | 49 | |
|
50 | 50 | 87 | fn self_and_out<'s>(&'s self) -> &'s u8 { &self.x }
|
51 | 51 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
52 | 52 |
|
53 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 53 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
54 | 54 | --> $DIR/lifetimes.rs:91:5
|
55 | 55 | |
|
56 | 56 | 91 | fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) { }
|
57 | 57 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
58 | 58 |
|
59 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 59 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
60 | 60 | --> $DIR/lifetimes.rs:107:1
|
61 | 61 | |
|
62 | 62 | 107 | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { unimplemented!() }
|
63 | 63 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
64 | 64 |
|
65 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 65 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
66 | 66 | --> $DIR/lifetimes.rs:127:1
|
67 | 67 | |
|
68 | 68 | 127 | fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() }
|
69 | 69 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
70 | 70 |
|
71 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 71 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
72 | 72 | --> $DIR/lifetimes.rs:131:1
|
73 | 73 | |
|
74 | 74 | 131 | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { unimplemented!() }
|
75 | 75 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
76 | 76 |
|
77 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 77 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
78 | 78 | --> $DIR/lifetimes.rs:142:1
|
79 | 79 | |
|
80 | 80 | 142 | fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() }
|
81 | 81 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
82 | 82 |
|
83 |
| -error: explicit lifetimes given in parameter types where they could be elided |
| 83 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
84 | 84 | --> $DIR/lifetimes.rs:146:1
|
85 | 85 | |
|
86 | 86 | 146 | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { unimplemented!() }
|
87 | 87 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
88 | 88 |
|
89 |
| -error: aborting due to 14 previous errors |
| 89 | +error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) |
| 90 | + --> $DIR/lifetimes.rs:176:1 |
| 91 | + | |
| 92 | +176 | fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> { unimplemented!() } |
| 93 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 94 | + |
| 95 | +error: aborting due to 15 previous errors |
90 | 96 |
|
0 commit comments