rust/src/test/compile-fail/issue-1896.rs

9 lines
224 B
Rust
Raw Normal View History

2012-11-01 17:14:36 -05:00
type t<T> = { f: fn() -> T };
fn f<T>(_x: t<T>) {}
fn main() {
let x: t<()> = { f: { || () } }; //~ ERROR expected & closure, found @ closure
//~^ ERROR in field `f`, expected & closure, found @ closure
f(x);
2012-11-01 17:14:36 -05:00
}