2022-04-19 05:56:18 -05:00
|
|
|
// revisions: base nll
|
|
|
|
// ignore-compare-mode-nll
|
|
|
|
//[nll] compile-flags: -Z borrowck=mir
|
|
|
|
|
2018-12-16 21:21:47 -06:00
|
|
|
enum Ast<'a> {
|
|
|
|
Num(usize),
|
|
|
|
Add(&'a Ast<'a>, &'a Ast<'a>)
|
2012-04-21 12:04:58 -05:00
|
|
|
}
|
|
|
|
|
2018-12-16 21:21:47 -06:00
|
|
|
fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> {
|
2022-04-19 05:56:18 -05:00
|
|
|
Ast::Add(x, y)
|
|
|
|
//[base]~^ ERROR lifetime mismatch [E0623]
|
|
|
|
//[nll]~^^ ERROR lifetime may not live long enough
|
2012-04-21 12:04:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-08-13 17:06:13 -05:00
|
|
|
}
|