]> git.proxmox.com Git - rustc.git/blame - src/test/ui/in-band-lifetimes/mismatched.nll.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / in-band-lifetimes / mismatched.nll.stderr
CommitLineData
48663c56
XL
1error[E0621]: explicit lifetime required in the type of `y`
2 --> $DIR/mismatched.rs:4:42
3 |
4LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y }
5 | ---- ^ lifetime `'a` required
6 | |
7 | help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
8
9error: lifetime may not live long enough
10 --> $DIR/mismatched.rs:6:46
11 |
12LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y }
13 | -- -- ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
14 | | |
15 | | lifetime `'b` defined here
16 | lifetime `'a` defined here
60c5eb7d
XL
17 |
18 = help: consider adding the following bound: `'b: 'a`
48663c56
XL
19
20error: aborting due to 2 previous errors
21
22For more information about this error, try `rustc --explain E0621`.