Skip to content

Commit e399ddb

Browse files
committed
allow binding of fn~, make result fn@. fixes 1899.
1 parent f80008f commit e399ddb

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

src/rustc/middle/typeck.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,8 +2609,10 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
26092609
}
26102610

26112611
let proto = alt proto {
2612-
ast::proto_bare | ast::proto_box { ast::proto_box }
2613-
ast::proto_uniq | ast::proto_any | ast::proto_block {
2612+
ast::proto_bare | ast::proto_box | ast::proto_uniq {
2613+
ast::proto_box
2614+
}
2615+
ast::proto_any | ast::proto_block {
26142616
tcx.sess.span_err(expr.span,
26152617
#fmt["cannot bind %s closures",
26162618
proto_to_str(proto)]);

src/test/compile-fail/bind-unique-closure.rs

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/test/run-pass/issue-1899.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main()
2+
{
3+
let _b = [bind (fn~() {})()];
4+
}

0 commit comments

Comments
 (0)