mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
13 lines
220 B
Rust
13 lines
220 B
Rust
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() {
|
|
}
|