1 error: explicit lifetimes given in parameter types where they could be elided
2 --> $DIR/lifetimes.rs:7:1
4 7 | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) { }
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 note: lint level defined here
8 --> $DIR/lifetimes.rs:4:9
10 4 | #![deny(needless_lifetimes, unused_lifetimes)]
13 error: explicit lifetimes given in parameter types where they could be elided
14 --> $DIR/lifetimes.rs:9:1
16 9 | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) { }
17 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19 error: explicit lifetimes given in parameter types where they could be elided
20 --> $DIR/lifetimes.rs:17:1
22 17 | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 { x }
23 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 error: explicit lifetimes given in parameter types where they could be elided
26 --> $DIR/lifetimes.rs:29:1
28 29 | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> { Ok(x) }
29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31 error: explicit lifetimes given in parameter types where they could be elided
32 --> $DIR/lifetimes.rs:32:1
34 32 | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> where T: Copy { Ok(x) }
35 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37 error: explicit lifetimes given in parameter types where they could be elided
38 --> $DIR/lifetimes.rs:38:1
40 38 | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) { }
41 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43 error: explicit lifetimes given in parameter types where they could be elided
44 --> $DIR/lifetimes.rs:52:1
46 52 | / fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
47 53 | | where for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>
48 54 | | { unreachable!() }
49 | |__________________^
51 error: explicit lifetimes given in parameter types where they could be elided
52 --> $DIR/lifetimes.rs:61:5
54 61 | fn self_and_out<'s>(&'s self) -> &'s u8 { &self.x }
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57 error: explicit lifetimes given in parameter types where they could be elided
58 --> $DIR/lifetimes.rs:65:5
60 65 | fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) { }
61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63 error: explicit lifetimes given in parameter types where they could be elided
64 --> $DIR/lifetimes.rs:81:1
66 81 | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { unimplemented!() }
67 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69 error: explicit lifetimes given in parameter types where they could be elided
70 --> $DIR/lifetimes.rs:101:1
72 101 | fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() }
73 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75 error: explicit lifetimes given in parameter types where they could be elided
76 --> $DIR/lifetimes.rs:105:1
78 105 | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { unimplemented!() }
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81 error: explicit lifetimes given in parameter types where they could be elided
82 --> $DIR/lifetimes.rs:116:1
84 116 | fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() }
85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87 error: explicit lifetimes given in parameter types where they could be elided
88 --> $DIR/lifetimes.rs:120:1
90 120 | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { unimplemented!() }
91 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93 error: aborting due to 14 previous errors