]> git.lizzy.rs Git - rust.git/blob - tests/ui/lifetimes.stderr
Merge pull request #1520 from Manishearth/rustup
[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:10:1
15    |
16 10 | 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:19:1
21    |
22 19 | 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:32:1
27    |
28 32 | 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:36:1
33    |
34 36 | 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:43:1
39    |
40 43 | 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:58:1
45    |
46 58 |   fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
47    |  _^ starting here...
48 59 | |     where for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>
49 60 | | { unreachable!() }
50    | |__________________^ ...ending here
51
52 error: explicit lifetimes given in parameter types where they could be elided
53   --> $DIR/lifetimes.rs:67:5
54    |
55 67 |     fn self_and_out<'s>(&'s self) -> &'s u8 { &self.x }
56    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57
58 error: explicit lifetimes given in parameter types where they could be elided
59   --> $DIR/lifetimes.rs:72:5
60    |
61 72 |     fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) { }
62    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63
64 error: explicit lifetimes given in parameter types where they could be elided
65   --> $DIR/lifetimes.rs:89:1
66    |
67 89 | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { unimplemented!() }
68    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69
70 error: explicit lifetimes given in parameter types where they could be elided
71    --> $DIR/lifetimes.rs:109:1
72     |
73 109 | fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() }
74     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75
76 error: explicit lifetimes given in parameter types where they could be elided
77    --> $DIR/lifetimes.rs:113:1
78     |
79 113 | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { unimplemented!() }
80     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81
82 error: explicit lifetimes given in parameter types where they could be elided
83    --> $DIR/lifetimes.rs:124:1
84     |
85 124 | fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() }
86     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87
88 error: explicit lifetimes given in parameter types where they could be elided
89    --> $DIR/lifetimes.rs:128:1
90     |
91 128 | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { unimplemented!() }
92     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93
94 error: aborting due to 14 previous errors
95