]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-55394.stderr
Rollup merge of #83807 - sjakobi:77548-remove-ignore-annotations, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / issue-55394.stderr
1 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'s` due to conflicting requirements
2   --> $DIR/issue-55394.rs:9:9
3    |
4 LL |         Foo { bar }
5    |         ^^^
6    |
7 note: first, the lifetime cannot outlive the anonymous lifetime defined on the method body at 8:17...
8   --> $DIR/issue-55394.rs:8:17
9    |
10 LL |     fn new(bar: &mut Bar) -> Self {
11    |                 ^^^^^^^^
12 note: ...so that reference does not outlive borrowed content
13   --> $DIR/issue-55394.rs:9:15
14    |
15 LL |         Foo { bar }
16    |               ^^^
17 note: but, the lifetime must be valid for the lifetime `'_` as defined on the impl at 7:10...
18   --> $DIR/issue-55394.rs:7:10
19    |
20 LL | impl Foo<'_> {
21    |          ^^
22 note: ...so that the expression is assignable
23   --> $DIR/issue-55394.rs:9:9
24    |
25 LL |         Foo { bar }
26    |         ^^^^^^^^^^^
27    = note: expected `Foo<'_>`
28               found `Foo<'_>`
29
30 error: aborting due to previous error
31
32 For more information about this error, try `rustc --explain E0495`.