]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr
Account for --remap-path-prefix in save-analysis
[rust.git] / src / test / ui / lifetime-errors / 42701_one_named_and_one_anonymous.nll.stderr
1 warning: not reporting region error due to nll
2   --> $DIR/42701_one_named_and_one_anonymous.rs:20:9
3    |
4 LL |         &*x //~ ERROR explicit lifetime
5    |         ^^^
6
7 error[E0621]: explicit lifetime required in the type of `x`
8   --> $DIR/42701_one_named_and_one_anonymous.rs:16:5
9    |
10 LL |   fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
11    |                           - consider changing the type of `x` to `&'a i32`
12 LL | /     if true {
13 LL | |         let p: &i32 = &a.field;
14 LL | |         &*p
15 LL | |     } else {
16 LL | |         &*x //~ ERROR explicit lifetime
17 LL | |     }
18    | |_____^ lifetime `'a` required
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0621`.