]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-bounds.nll.stderr
Use the same message as type & const generics.
[rust.git] / src / test / ui / regions / regions-bounds.nll.stderr
1 error: lifetime may not live long enough
2   --> $DIR/regions-bounds.rs:13:12
3    |
4 LL | fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> {
5    |          -- -- lifetime `'b` defined here
6    |          |
7    |          lifetime `'a` defined here
8 LL |     return e;
9    |            ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
10    |
11    = help: consider adding the following bound: `'a: 'b`
12
13 error: lifetime may not live long enough
14   --> $DIR/regions-bounds.rs:19:12
15    |
16 LL | fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {
17    |          -- -- lifetime `'b` defined here
18    |          |
19    |          lifetime `'a` defined here
20 LL |     return e;
21    |            ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
22    |
23    = help: consider adding the following bound: `'a: 'b`
24
25 error: aborting due to 2 previous errors
26