]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-creating-enums4.stderr
Auto merge of #60093 - GuillaumeGomez:fix-attrs-pos, r=Manishearth
[rust.git] / src / test / ui / regions / regions-creating-enums4.stderr
1 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
2   --> $DIR/regions-creating-enums4.rs:7:5
3    |
4 LL |     Ast::Add(x, y)
5    |     ^^^^^^^^
6    |
7 note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 6:16...
8   --> $DIR/regions-creating-enums4.rs:6:16
9    |
10 LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
11    |                ^^
12    = note: ...so that the expression is assignable:
13            expected &Ast<'_>
14               found &Ast<'a>
15 note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 6:19...
16   --> $DIR/regions-creating-enums4.rs:6:19
17    |
18 LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
19    |                   ^^
20    = note: ...so that the expression is assignable:
21            expected Ast<'b>
22               found Ast<'_>
23
24 error: aborting due to previous error
25