]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr
Rollup merge of #53110 - Xanewok:save-analysis-remap-path, r=nrc
[rust.git] / src / test / ui / lifetime-errors / ex1-return-one-existing-name-if-else-using-impl-3.stderr
1 error[E0621]: explicit lifetime required in the type of `x`
2   --> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:36
3    |
4 LL |   fn foo<'a>(&'a self, x: &i32) -> &i32 {
5    |                           ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
6 LL | 
7 LL |     if true { &self.field } else { x } //~ ERROR explicit lifetime
8    |                                    ^ lifetime `'a` required
9
10 error: aborting due to previous error
11
12 For more information about this error, try `rustc --explain E0621`.