rust/src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr

37 lines
1.3 KiB
Plaintext

warning: not reporting region error due to nll
--> $DIR/regions-free-region-ordering-callee.rs:23:5
|
LL | &*y //~ ERROR 23:5: 23:8: lifetime mismatch [E0623]
| ^^^
warning: not reporting region error due to nll
--> $DIR/regions-free-region-ordering-callee.rs:28:24
|
LL | let z: &'b usize = &*x;
| ^^^
error: unsatisfied lifetime constraints
--> $DIR/regions-free-region-ordering-callee.rs:23:5
|
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 //~ ERROR 23:5: 23:8: lifetime mismatch [E0623]
| ^^^ requires that `'a` must outlive `'b`
error: unsatisfied lifetime constraints
--> $DIR/regions-free-region-ordering-callee.rs:28:24
|
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;
| ^^^ requires that `'a` must outlive `'b`
error: aborting due to 2 previous errors