@@ -2,133 +2,105 @@ error: explicit lifetimes given in parameter types where they could be elided (o
2
2
--> $DIR/needless_lifetimes.rs:4:1
3
3
|
4
4
LL | 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
9
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
10
10
--> $DIR/needless_lifetimes.rs:6:1
11
11
|
12
12
LL | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {}
13
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
14
15
15
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
16
16
--> $DIR/needless_lifetimes.rs:16:1
17
17
|
18
- LL | / fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
19
- LL | | x
20
- LL | | }
21
- | |_^
18
+ LL | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
19
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22
20
23
21
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
24
22
--> $DIR/needless_lifetimes.rs:45:1
25
23
|
26
- LL | / fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> {
27
- LL | | Ok(x)
28
- LL | | }
29
- | |_^
24
+ LL | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> {
25
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
26
31
27
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
32
28
--> $DIR/needless_lifetimes.rs:50:1
33
29
|
34
- LL | / fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()>
35
- LL | | where
36
- LL | | T: Copy,
37
- LL | | {
38
- LL | | Ok(x)
39
- LL | | }
40
- | |_^
30
+ LL | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()>
31
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41
32
42
33
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
43
34
--> $DIR/needless_lifetimes.rs:62:1
44
35
|
45
36
LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
46
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47
38
48
39
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
49
40
--> $DIR/needless_lifetimes.rs:86:1
50
41
|
51
- LL | / fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
52
- LL | | where
53
- LL | | for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>,
54
- LL | | {
55
- LL | | unreachable!()
56
- LL | | }
57
- | |_^
42
+ LL | fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
43
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
44
59
45
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
60
46
--> $DIR/needless_lifetimes.rs:120:5
61
47
|
62
- LL | / fn self_and_out<'s>(&'s self) -> &'s u8 {
63
- LL | | &self.x
64
- LL | | }
65
- | |_____^
48
+ LL | fn self_and_out<'s>(&'s self) -> &'s u8 {
49
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
50
67
51
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
68
52
--> $DIR/needless_lifetimes.rs:129:5
69
53
|
70
54
LL | fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) {}
71
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72
56
73
57
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
74
58
--> $DIR/needless_lifetimes.rs:148:1
75
59
|
76
- LL | / fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
77
- LL | | unimplemented!()
78
- LL | | }
79
- | |_^
60
+ LL | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
61
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80
62
81
63
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
82
64
--> $DIR/needless_lifetimes.rs:178:1
83
65
|
84
- LL | / fn trait_obj_elided2<'a>(_arg: &'a dyn Drop) -> &'a str {
85
- LL | | unimplemented!()
86
- LL | | }
87
- | |_^
66
+ LL | fn trait_obj_elided2<'a>(_arg: &'a dyn Drop) -> &'a str {
67
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88
68
89
69
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
90
70
--> $DIR/needless_lifetimes.rs:184:1
91
71
|
92
- LL | / fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
93
- LL | | unimplemented!()
94
- LL | | }
95
- | |_^
72
+ LL | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
73
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96
74
97
75
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
98
76
--> $DIR/needless_lifetimes.rs:203:1
99
77
|
100
- LL | / fn named_input_elided_output<'a>(_arg: &'a str) -> &str {
101
- LL | | unimplemented!()
102
- LL | | }
103
- | |_^
78
+ LL | fn named_input_elided_output<'a>(_arg: &'a str) -> &str {
79
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
80
105
81
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
106
82
--> $DIR/needless_lifetimes.rs:211:1
107
83
|
108
- LL | / fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) {
109
- LL | | unimplemented!()
110
- LL | | }
111
- | |_^
84
+ LL | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) {
85
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112
86
113
87
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
114
88
--> $DIR/needless_lifetimes.rs:247:1
115
89
|
116
- LL | / fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
117
- LL | | unimplemented!()
118
- LL | | }
119
- | |_^
90
+ LL | fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
91
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120
92
121
93
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
122
94
--> $DIR/needless_lifetimes.rs:254:9
123
95
|
124
96
LL | fn needless_lt<'a>(x: &'a u8) {}
125
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
97
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126
98
127
99
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
128
100
--> $DIR/needless_lifetimes.rs:258:9
129
101
|
130
102
LL | fn needless_lt<'a>(_x: &'a u8) {}
131
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132
104
133
105
error: aborting due to 17 previous errors
134
106
0 commit comments