blob: c07921bce2d72cb2eefd72e94c8bb518160fa606 [file] [log] [blame]
warning: not reporting region error due to nll
--> $DIR/mismatched.rs:14:42
|
LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
| ^
warning: not reporting region error due to nll
--> $DIR/mismatched.rs:16:46
|
LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
| ^
error[E0621]: explicit lifetime required in the type of `y`
--> $DIR/mismatched.rs:14:42
|
LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
| ---- ^ lifetime `'a` required
| |
| help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
error: unsatisfied lifetime constraints
--> $DIR/mismatched.rs:16:46
|
LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
| -- -- ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
| | |
| | lifetime `'b` defined here
| lifetime `'a` defined here
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0621`.