]> git.lizzy.rs Git - rust.git/blob - tests/ui/lifetimes.stderr
Merge pull request #1747 from Manishearth/mut_fp
[rust.git] / tests / ui / lifetimes.stderr
1 error: explicit lifetimes given in parameter types where they could be elided
2  --> $DIR/lifetimes.rs:7:1
3   |
4 7 | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) { }
5   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6   |
7 note: lint level defined here
8  --> $DIR/lifetimes.rs:4:9
9   |
10 4 | #![deny(needless_lifetimes, unused_lifetimes)]
11   |         ^^^^^^^^^^^^^^^^^^
12
13 error: explicit lifetimes given in parameter types where they could be elided
14  --> $DIR/lifetimes.rs:9:1
15   |
16 9 | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) { }
17   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
19 error: explicit lifetimes given in parameter types where they could be elided
20   --> $DIR/lifetimes.rs:17:1
21    |
22 17 | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 { x }
23    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
25 error: explicit lifetimes given in parameter types where they could be elided
26   --> $DIR/lifetimes.rs:29:1
27    |
28 29 | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> { Ok(x) }
29    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
31 error: explicit lifetimes given in parameter types where they could be elided
32   --> $DIR/lifetimes.rs:32:1
33    |
34 32 | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> where T: Copy { Ok(x) }
35    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36
37 error: explicit lifetimes given in parameter types where they could be elided
38   --> $DIR/lifetimes.rs:38:1
39    |
40 38 | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) { }
41    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42
43 error: explicit lifetimes given in parameter types where they could be elided
44   --> $DIR/lifetimes.rs:52:1
45    |
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    | |__________________^
50
51 error: explicit lifetimes given in parameter types where they could be elided
52   --> $DIR/lifetimes.rs:61:5
53    |
54 61 |     fn self_and_out<'s>(&'s self) -> &'s u8 { &self.x }
55    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56
57 error: explicit lifetimes given in parameter types where they could be elided
58   --> $DIR/lifetimes.rs:65:5
59    |
60 65 |     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
64   --> $DIR/lifetimes.rs:81:1
65    |
66 81 | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { unimplemented!() }
67    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68
69 error: explicit lifetimes given in parameter types where they could be elided
70    --> $DIR/lifetimes.rs:101:1
71     |
72 101 | fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() }
73     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74
75 error: explicit lifetimes given in parameter types where they could be elided
76    --> $DIR/lifetimes.rs:105:1
77     |
78 105 | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { unimplemented!() }
79     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80
81 error: explicit lifetimes given in parameter types where they could be elided
82    --> $DIR/lifetimes.rs:116:1
83     |
84 116 | fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() }
85     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86
87 error: explicit lifetimes given in parameter types where they could be elided
88    --> $DIR/lifetimes.rs:120:1
89     |
90 120 | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { unimplemented!() }
91     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92
93 error: aborting due to 14 previous errors
94