1 warning: not reporting region error due to nll
2 --> $DIR/mismatched.rs:14:42
4 LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
7 warning: not reporting region error due to nll
8 --> $DIR/mismatched.rs:16:46
10 LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
13 error[E0621]: explicit lifetime required in the type of `y`
14 --> $DIR/mismatched.rs:14:42
16 LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
17 | ---- ^ lifetime `'a` required
19 | help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
21 error: unsatisfied lifetime constraints
22 --> $DIR/mismatched.rs:16:46
24 LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
25 | -- -- ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
27 | | lifetime `'b` defined here
28 | lifetime `'a` defined here
30 error: aborting due to 2 previous errors
32 For more information about this error, try `rustc --explain E0621`.