Skip to content

Commit 330b2e8

Browse files
committed
---
yaml --- r: 2771 b: refs/heads/master c: 6473b73 h: refs/heads/master i: 2769: c4adc76 2767: 0578bfd v: v3
1 parent 8d65a22 commit 330b2e8

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
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: 0c1ea141b4e207caaae524a4e770cf593353319e
2+
refs/heads/master: 6473b73174afc54198c4105f7fa927f04a71e04e

trunk/src/comp/middle/typeck.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,23 +2386,8 @@ fn check_expr(&@stmt_ctxt scx, &@ast::expr expr) {
23862386
case (ast::expr_spawn(_, _, ?f, ?args, ?a)) {
23872387
check_call(scx, f, args);
23882388

2389-
// Check the return type
23902389
auto fty = expr_ty(scx.fcx.ccx.tcx, f);
2391-
alt (struct(scx.fcx.ccx.tcx, fty)) {
2392-
case (ty::ty_fn(_,_,?rt,_)) {
2393-
alt (struct(scx.fcx.ccx.tcx, rt)) {
2394-
case (ty::ty_nil) {
2395-
// This is acceptable
2396-
}
2397-
case (_) {
2398-
auto err = "non-nil return type in "
2399-
+ "spawned function";
2400-
scx.fcx.ccx.tcx.sess.span_err(expr.span, err);
2401-
fail;
2402-
}
2403-
}
2404-
}
2405-
}
2390+
Demand::simple(scx, f.span, ty::mk_nil(scx.fcx.ccx.tcx), fty);
24062391

24072392
// FIXME: Other typechecks needed
24082393

trunk/src/test/compile-fail/spawn-non-nil-fn.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// xfail-stage0
2-
// xfail-stage1
3-
// xfail-stage2
42
// error-pattern: mismatched types
53

64
fn f(int x) -> int {

0 commit comments

Comments
 (0)