]> git.lizzy.rs Git - rust.git/blob - src/test/ui/in-band-lifetimes/mismatched.nll.stderr
#52413: addressed @estebank's Nit
[rust.git] / src / test / ui / in-band-lifetimes / mismatched.nll.stderr
1 warning: not reporting region error due to nll
2   --> $DIR/mismatched.rs:14:42
3    |
4 LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
5    |                                          ^
6
7 warning: not reporting region error due to nll
8   --> $DIR/mismatched.rs:16:46
9    |
10 LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
11    |                                              ^
12
13 error[E0621]: explicit lifetime required in the type of `y`
14   --> $DIR/mismatched.rs:14:42
15    |
16 LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
17    |                       ----               ^ lifetime `'a` required
18    |                       |
19    |                       help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
20
21 error[E0623]: lifetime mismatch
22   --> $DIR/mismatched.rs:16:46
23    |
24 LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
25    |                        -------     -------   ^ ...but data from `y` is returned here
26    |                        |
27    |                        this parameter and the return type are declared with different lifetimes...
28
29 error: aborting due to 2 previous errors
30
31 Some errors occurred: E0621, E0623.
32 For more information about an error, try `rustc --explain E0621`.