Closed
Description
UPDATE: I updated the title to reflect the root problem. "Closure inference" refers to detailing the specifics of a closure type, such as its bounds and so forth. Ideally, only the argument types would derive from the expected type (with a fallback to fresh type variables).
original issue report follows:
type t = {
f: fn~()
};
fn main() {
let _t: t = { f: {||()} };
}
../src/test/run-pass/test.rs:6:16: 6:29 error: mismatched types: expected `t` but found `{f: fn@()}` (in field `f`, closure protocol mismatch (fn~ vs fn@))
../src/test/run-pass/test.rs:6 let _t: t = { f: {||()} };