]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_lifetimes.stderr
Bless clippy test.
[rust.git] / tests / ui / needless_lifetimes.stderr
1 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
2   --> $DIR/needless_lifetimes.rs:10:1
3    |
4 LL | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
8
9 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
10   --> $DIR/needless_lifetimes.rs:12:1
11    |
12 LL | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {}
13    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
15 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
16   --> $DIR/needless_lifetimes.rs:22:1
17    |
18 LL | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
19    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20
21 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
22   --> $DIR/needless_lifetimes.rs:37:1
23    |
24 LL | async fn func<'a>(args: &[&'a str]) -> Option<&'a str> {
25    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
27 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
28   --> $DIR/needless_lifetimes.rs:56:1
29    |
30 LL | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> {
31    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32
33 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
34   --> $DIR/needless_lifetimes.rs:61:1
35    |
36 LL | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()>
37    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
39 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
40   --> $DIR/needless_lifetimes.rs:73:1
41    |
42 LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
43    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44
45 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
46   --> $DIR/needless_lifetimes.rs:97:1
47    |
48 LL | fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
49    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
51 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
52   --> $DIR/needless_lifetimes.rs:127:5
53    |
54 LL |     fn self_and_out<'s>(&'s self) -> &'s u8 {
55    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56
57 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
58   --> $DIR/needless_lifetimes.rs:136:5
59    |
60 LL |     fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) {}
61    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62
63 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
64   --> $DIR/needless_lifetimes.rs:155:1
65    |
66 LL | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
67    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68
69 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
70   --> $DIR/needless_lifetimes.rs:185:1
71    |
72 LL | fn trait_obj_elided2<'a>(_arg: &'a dyn Drop) -> &'a str {
73    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74
75 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
76   --> $DIR/needless_lifetimes.rs:191:1
77    |
78 LL | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
79    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80
81 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
82   --> $DIR/needless_lifetimes.rs:210:1
83    |
84 LL | fn named_input_elided_output<'a>(_arg: &'a str) -> &str {
85    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86
87 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
88   --> $DIR/needless_lifetimes.rs:218:1
89    |
90 LL | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) {
91    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92
93 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
94   --> $DIR/needless_lifetimes.rs:254:1
95    |
96 LL | fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
97    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98
99 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
100   --> $DIR/needless_lifetimes.rs:261:9
101    |
102 LL |         fn needless_lt<'a>(x: &'a u8) {}
103    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
105 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
106   --> $DIR/needless_lifetimes.rs:265:9
107    |
108 LL |         fn needless_lt<'a>(_x: &'a u8) {}
109    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110
111 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
112   --> $DIR/needless_lifetimes.rs:278:9
113    |
114 LL |         fn baz<'a>(&'a self) -> impl Foo + 'a {
115    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
116
117 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
118   --> $DIR/needless_lifetimes.rs:307:5
119    |
120 LL |     fn impl_trait_elidable_nested_named_lifetimes<'a>(i: &'a i32, f: impl for<'b> Fn(&'b i32) -> &'b i32) -> &'a i32 {
121    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122
123 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
124   --> $DIR/needless_lifetimes.rs:310:5
125    |
126 LL |     fn impl_trait_elidable_nested_anonymous_lifetimes<'a>(i: &'a i32, f: impl Fn(&i32) -> &i32) -> &'a i32 {
127    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128
129 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
130   --> $DIR/needless_lifetimes.rs:319:5
131    |
132 LL |     fn generics_elidable<'a, T: Fn(&i32) -> &i32>(i: &'a i32, f: T) -> &'a i32 {
133    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134
135 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
136   --> $DIR/needless_lifetimes.rs:331:5
137    |
138 LL |     fn where_clause_elidadable<'a, T>(i: &'a i32, f: T) -> &'a i32
139    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140
141 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
142   --> $DIR/needless_lifetimes.rs:346:5
143    |
144 LL |     fn pointer_fn_elidable<'a>(i: &'a i32, f: fn(&i32) -> &i32) -> &'a i32 {
145    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146
147 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
148   --> $DIR/needless_lifetimes.rs:359:5
149    |
150 LL |     fn nested_fn_pointer_3<'a>(_: &'a i32) -> fn(fn(&i32) -> &i32) -> i32 {
151    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152
153 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
154   --> $DIR/needless_lifetimes.rs:362:5
155    |
156 LL |     fn nested_fn_pointer_4<'a>(_: &'a i32) -> impl Fn(fn(&i32)) {
157    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158
159 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
160   --> $DIR/needless_lifetimes.rs:384:9
161    |
162 LL |         fn implicit<'a>(&'a self) -> &'a () {
163    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
164
165 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
166   --> $DIR/needless_lifetimes.rs:387:9
167    |
168 LL |         fn implicit_mut<'a>(&'a mut self) -> &'a () {
169    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170
171 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
172   --> $DIR/needless_lifetimes.rs:398:9
173    |
174 LL |         fn lifetime_elsewhere<'a>(self: Box<Self>, here: &'a ()) -> &'a () {
175    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176
177 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
178   --> $DIR/needless_lifetimes.rs:404:9
179    |
180 LL |         fn implicit<'a>(&'a self) -> &'a ();
181    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
182
183 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
184   --> $DIR/needless_lifetimes.rs:405:9
185    |
186 LL |         fn implicit_provided<'a>(&'a self) -> &'a () {
187    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188
189 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
190   --> $DIR/needless_lifetimes.rs:414:9
191    |
192 LL |         fn lifetime_elsewhere<'a>(self: Box<Self>, here: &'a ()) -> &'a ();
193    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194
195 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
196   --> $DIR/needless_lifetimes.rs:415:9
197    |
198 LL |         fn lifetime_elsewhere_provided<'a>(self: Box<Self>, here: &'a ()) -> &'a () {
199    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
200
201 error: aborting due to 33 previous errors
202