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

8 lines
151 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: { || () } };
f(x); //~ ERROR copying a noncopyable value
}