blob: a62d7cc5a6fd1b8ae12b43361bb2a0186b476915 [file] [log] [blame]
warning: not reporting region error due to nll
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:36
|
LL | if true { &self.field } else { x } //~ ERROR explicit lifetime
| ^
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:5
|
LL | fn foo<'a>(&'a self, x: &i32) -> &i32 {
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
LL |
LL | if true { &self.field } else { x } //~ ERROR explicit lifetime
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
error: aborting due to previous error
For more information about this error, try `rustc --explain E0621`.