]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/needless_lifetimes.stderr
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / needless_lifetimes.stderr
CommitLineData
f20569fa
XL
1error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
2 --> $DIR/needless_lifetimes.rs:4:1
3 |
4LL | 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
9error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
10 --> $DIR/needless_lifetimes.rs:6:1
11 |
12LL | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {}
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
15error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
16 --> $DIR/needless_lifetimes.rs:16:1
17 |
18LL | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20
21error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
22 --> $DIR/needless_lifetimes.rs:45:1
23 |
24LL | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> {
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
27error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
28 --> $DIR/needless_lifetimes.rs:50:1
29 |
30LL | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()>
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32
33error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
34 --> $DIR/needless_lifetimes.rs:62:1
35 |
36LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
39error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
40 --> $DIR/needless_lifetimes.rs:86:1
41 |
42LL | fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44
45error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
46 --> $DIR/needless_lifetimes.rs:116:5
47 |
48LL | fn self_and_out<'s>(&'s self) -> &'s u8 {
49 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
51error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
52 --> $DIR/needless_lifetimes.rs:125:5
53 |
54LL | fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) {}
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56
57error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
58 --> $DIR/needless_lifetimes.rs:144:1
59 |
60LL | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62
63error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
64 --> $DIR/needless_lifetimes.rs:174:1
65 |
66LL | fn trait_obj_elided2<'a>(_arg: &'a dyn Drop) -> &'a str {
67 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68
69error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
70 --> $DIR/needless_lifetimes.rs:180:1
71 |
72LL | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
73 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74
75error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
76 --> $DIR/needless_lifetimes.rs:199:1
77 |
78LL | fn named_input_elided_output<'a>(_arg: &'a str) -> &str {
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80
81error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
82 --> $DIR/needless_lifetimes.rs:207:1
83 |
84LL | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) {
85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86
87error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
88 --> $DIR/needless_lifetimes.rs:243:1
89 |
90LL | fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
91 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92
93error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
94 --> $DIR/needless_lifetimes.rs:250:9
95 |
96LL | fn needless_lt<'a>(x: &'a u8) {}
97 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98
99error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
100 --> $DIR/needless_lifetimes.rs:254:9
101 |
102LL | fn needless_lt<'a>(_x: &'a u8) {}
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
105error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
106 --> $DIR/needless_lifetimes.rs:267:9
107 |
108LL | fn baz<'a>(&'a self) -> impl Foo + 'a {
109 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110
111error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
112 --> $DIR/needless_lifetimes.rs:296:5
113 |
114LL | fn impl_trait_elidable_nested_named_lifetimes<'a>(i: &'a i32, f: impl for<'b> Fn(&'b i32) -> &'b i32) -> &'a i32 {
115 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
116
117error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
118 --> $DIR/needless_lifetimes.rs:299:5
119 |
120LL | fn impl_trait_elidable_nested_anonymous_lifetimes<'a>(i: &'a i32, f: impl Fn(&i32) -> &i32) -> &'a i32 {
121 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122
123error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
124 --> $DIR/needless_lifetimes.rs:308:5
125 |
126LL | fn generics_elidable<'a, T: Fn(&i32) -> &i32>(i: &'a i32, f: T) -> &'a i32 {
127 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128
129error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
130 --> $DIR/needless_lifetimes.rs:320:5
131 |
132LL | fn where_clause_elidadable<'a, T>(i: &'a i32, f: T) -> &'a i32
133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134
135error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
136 --> $DIR/needless_lifetimes.rs:335:5
137 |
138LL | fn pointer_fn_elidable<'a>(i: &'a i32, f: fn(&i32) -> &i32) -> &'a i32 {
139 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140
141error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
142 --> $DIR/needless_lifetimes.rs:348:5
143 |
144LL | fn nested_fn_pointer_3<'a>(_: &'a i32) -> fn(fn(&i32) -> &i32) -> i32 {
145 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146
147error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
148 --> $DIR/needless_lifetimes.rs:351:5
149 |
150LL | fn nested_fn_pointer_4<'a>(_: &'a i32) -> impl Fn(fn(&i32)) {
151 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152
153error: aborting due to 25 previous errors
154