]> git.lizzy.rs Git - rust.git/blob - src/test/ui/in-band-lifetimes/mismatched.stderr
Rollup merge of #53110 - Xanewok:save-analysis-remap-path, r=nrc
[rust.git] / src / test / ui / in-band-lifetimes / mismatched.stderr
1 error[E0621]: explicit lifetime required in the type of `y`
2   --> $DIR/mismatched.rs:14:42
3    |
4 LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
5    |                       ----               ^ lifetime `'a` required
6    |                       |
7    |                       help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
8
9 error[E0623]: lifetime mismatch
10   --> $DIR/mismatched.rs:16:46
11    |
12 LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
13    |                        -------     -------   ^ ...but data from `y` is returned here
14    |                        |
15    |                        this parameter and the return type are declared with different lifetimes...
16
17 error: aborting due to 2 previous errors
18
19 Some errors occurred: E0621, E0623.
20 For more information about an error, try `rustc --explain E0621`.