rust/src/test/compile-fail/regions-creating-enums3.rs
Niko Matsakis 511e7626ae Infer variance of types with respect to the region parameter.
A similar approach could be used for type parameters.

Fixes #2282.
2012-08-23 06:30:43 -07:00

12 lines
176 B
Rust

enum ast {
num(uint),
add(&ast, &ast)
}
fn mk_add_bad1(x: &a/ast, y: &b/ast) -> ast/&a {
add(x, y) //~ ERROR cannot infer an appropriate lifetime
}
fn main() {
}