}
i += 1u;
}
- let ft = ty::mk_fn(tcx, proto, out_args, rt, cf, constrs);
+
+ // Determine what fn prototype results from binding
+ fn lower_bound_proto(proto: ast::proto) -> ast::proto {
+ // FIXME: This is right for bare fns, possibly not others
+ alt proto {
+ ast::proto_bare. { ast::proto_fn }
+ _ { proto }
+ }
+ }
+
+ let ft = ty::mk_fn(tcx, lower_bound_proto(proto),
+ out_args, rt, cf, constrs);
write::ty_only_fixup(fcx, id, ft);
}
ast::expr_call(f, args) {
--- /dev/null
+// error-pattern:mismatched types: expected fn#() but found fn()
+
+fn# f() {
+}
+
+fn main() {
+ // Can't produce a bare function by binding
+ let g: fn#() = bind f();
+}
\ No newline at end of file