| 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 `'b` but it is returning data with lifetime `'a` |
| | | | |
| | | 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`. |