2018-08-08 14:28:26 +02:00
|
|
|
error[E0623]: lifetime mismatch
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/regions-free-region-ordering-callee.rs:13:5
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize {
|
|
|
|
| ------------- ---------
|
|
|
|
| |
|
|
|
|
| this parameter and the return type are declared with different lifetimes...
|
|
|
|
LL | // However, it is not safe to assume that 'b <= 'a
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | &*y
|
2018-08-08 14:28:26 +02:00
|
|
|
| ^^^ ...but data from `x` is returned here
|
|
|
|
|
|
|
|
error[E0623]: lifetime mismatch
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/regions-free-region-ordering-callee.rs:18:24
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize {
|
|
|
|
| --------- -------------
|
|
|
|
| |
|
|
|
|
| this parameter and the return type are declared with different lifetimes...
|
|
|
|
LL | // Do not infer an ordering from the return value.
|
|
|
|
LL | let z: &'b usize = &*x;
|
|
|
|
| ^^^ ...but data from `x` is returned here
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|