Skip to content

Commit 8524a10

Browse files
author
Eric Holk
committed
---
yaml --- r: 2590 b: refs/heads/master c: 8d10594 h: refs/heads/master v: v3
1 parent c63c140 commit 8524a10

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 37768cba92f58c99cc320a02d67165d41d8642f6
2+
refs/heads/master: 8d10594ed5f1cf9f8690026f06c86af3a8e61f56

trunk/src/comp/middle/ty.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,6 +1743,7 @@ fn expr_ann(&@ast::expr e) -> ast::ann {
17431743
case (ast::expr_break(?a)) { ret a; }
17441744
case (ast::expr_cont(?a)) { ret a; }
17451745
case (ast::expr_self_method(_, ?a)) { ret a; }
1746+
case (ast::expr_spawn(_, _, _, _, ?a)) { ret a; }
17461747
}
17471748
}
17481749

trunk/src/comp/middle/typeck.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,22 @@ mod Pushdown {
15091509
e_1 = ast::expr_send(lval_1, expr_1, ann);
15101510
}
15111511

1512+
case (ast::expr_spawn(?dom, ?name, ?func, ?args, ?ann)) {
1513+
// TODO: This is copied from call, since spawn is sort of like
1514+
// a call expression. However, it's not doing anything with
1515+
// the domain or name parameters.
1516+
1517+
// NB: we call 'Demand::autoderef' and pass in adk only in
1518+
// cases where e is an expression that could *possibly*
1519+
// produce a box; things like expr_binary or expr_bind can't,
1520+
// so there's no need.
1521+
auto t = Demand::autoderef(fcx, e.span, expected,
1522+
ann_to_type(fcx.ccx.node_types, ann), adk);
1523+
e_1 = ast::expr_spawn(dom, name, func, args,
1524+
triv_ann(ast::ann_tag(ann), t));
1525+
write_type_only(fcx.ccx.node_types, ast::ann_tag(ann), t);
1526+
}
1527+
15121528
case (_) {
15131529
fcx.ccx.sess.span_unimpl(e.span,
15141530
#fmt("type unification for expression variant: %s",

0 commit comments

Comments
 (0)