rust/tests/ui/regions/regions-creating-enums3.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
220 B
Rust
Raw Normal View History

enum Ast<'a> {
Num(usize),
Add(&'a Ast<'a>, &'a Ast<'a>)
2012-04-22 01:04:58 +08:00
}
fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> {
Ast::Add(x, y)
2022-04-02 01:13:25 +08:00
//~^ ERROR lifetime may not live long enough
2012-04-22 01:04:58 +08:00
}
fn main() {
}