mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
13 lines
229 B
Rust
13 lines
229 B
Rust
enum Ast<'a> {
|
|
Num(usize),
|
|
Add(&'a Ast<'a>, &'a Ast<'a>)
|
|
}
|
|
|
|
fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
|
|
Ast::Add(x, y)
|
|
//~^ ERROR lifetime may not live long enough
|
|
}
|
|
|
|
fn main() {
|
|
}
|