b0ed151539
Fixes #1896 which was never truly fixed, just masked. The given tests would have failed had they used `~fn()` and not `@fn()`. They now result in compilation errors. Fixes #2978. Necessary first step for #2202, #2263.
9 lines
224 B
Rust
9 lines
224 B
Rust
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);
|
|
} |