summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-creating-enums3.rs
blob: 39dbb3d8a7d4de1744583e842eb0d7a4e4349380 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
enum Ast<'a> {
    Num(usize),
    Add(&'a Ast<'a>, &'a Ast<'a>)
}

fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> {
    Ast::Add(x, y)
    //~^ ERROR lifetime may not live long enough
}

fn main() {
}