]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr
Closes #52413: Provide structured suggestion instead of label
[rust.git] / src / test / ui / lifetime-errors / ex1-return-one-existing-name-if-else-2.nll.stderr
1 warning: not reporting region error due to nll
2   --> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:16
3    |
4 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
5    |                ^
6
7 error[E0621]: explicit lifetime required in the type of `x`
8   --> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:8
9    |
10 LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
11    |               ---- help: consider changing the type of `x` to : `&'a i32`
12 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
13    |        ^^^^^ lifetime `'a` required
14
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0621`.