2019-01-27 11:03:21 +00:00
|
|
|
error: lifetime may not live long enough
|
2022-04-19 10:56:18 +00:00
|
|
|
--> $DIR/regions-free-region-ordering-callee.rs:17:5
|
2019-01-27 11:03:21 +00:00
|
|
|
|
|
|
|
|
LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize {
|
|
|
|
| -- -- lifetime `'b` defined here
|
|
|
|
| |
|
|
|
|
| lifetime `'a` defined here
|
|
|
|
LL | // However, it is not safe to assume that 'b <= 'a
|
|
|
|
LL | &*y
|
|
|
|
| ^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
2019-10-27 14:39:14 +00:00
|
|
|
|
|
|
|
|
= help: consider adding the following bound: `'a: 'b`
|
2019-01-27 11:03:21 +00:00
|
|
|
|
|
|
|
error: lifetime may not live long enough
|
2022-04-19 10:56:18 +00:00
|
|
|
--> $DIR/regions-free-region-ordering-callee.rs:24:12
|
2019-01-27 11:03:21 +00:00
|
|
|
|
|
|
|
|
LL | fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize {
|
|
|
|
| -- -- lifetime `'b` defined here
|
|
|
|
| |
|
|
|
|
| lifetime `'a` defined here
|
|
|
|
LL | // Do not infer an ordering from the return value.
|
|
|
|
LL | let z: &'b usize = &*x;
|
|
|
|
| ^^^^^^^^^ type annotation requires that `'a` must outlive `'b`
|
2019-10-27 14:39:14 +00:00
|
|
|
|
|
|
|
|
= help: consider adding the following bound: `'a: 'b`
|
2019-01-27 11:03:21 +00:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|