rust/src/test/ui/regions/regions-creating-enums4.rs

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

18 lines
359 B
Rust
Raw Normal View History

// revisions: base nll
// ignore-compare-mode-nll
//[nll] compile-flags: -Z borrowck=mir
enum Ast<'a> {
Num(usize),
Add(&'a Ast<'a>, &'a Ast<'a>)
2012-04-21 12:04:58 -05:00
}
fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
Ast::Add(x, y)
//[base]~^ ERROR cannot infer
//[nll]~^^ ERROR lifetime may not live long enough
2012-04-21 12:04:58 -05:00
}
fn main() {
}