]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-creating-enums4.stderr
Rollup merge of #93112 - pietroalbini:pa-cve-2022-21658-nightly, r=pietroalbini
[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 here...
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   --> $DIR/regions-creating-enums4.rs:7:14
14    |
15 LL |     Ast::Add(x, y)
16    |              ^
17    = note: expected `&Ast<'_>`
18               found `&Ast<'a>`
19 note: but, the lifetime must be valid for the lifetime `'b` as defined here...
20   --> $DIR/regions-creating-enums4.rs:6:19
21    |
22 LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
23    |                   ^^
24 note: ...so that the types are compatible
25   --> $DIR/regions-creating-enums4.rs:7:5
26    |
27 LL |     Ast::Add(x, y)
28    |     ^^^^^^^^^^^^^^
29    = note: expected `Ast<'b>`
30               found `Ast<'_>`
31
32 error: aborting due to previous error
33
34 For more information about this error, try `rustc --explain E0495`.