]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/regions-creating-enums3.rs
add UI test + docs for `E0789`
[rust.git] / tests / ui / regions / regions-creating-enums3.rs
1 enum Ast<'a> {
2     Num(usize),
3     Add(&'a Ast<'a>, &'a Ast<'a>)
4 }
5
6 fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> {
7     Ast::Add(x, y)
8     //~^ ERROR lifetime may not live long enough
9 }
10
11 fn main() {
12 }