Skip to content

Commit 3dcb79d

Browse files
brsongraydon
authored andcommitted
Add a regression test for channels of nil, which happens to work in rustc, but not in rustboot
1 parent c02cdc3 commit 3dcb79d

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ TASK_XFAILS := $(addprefix $(S)src/test/run-pass/, \
501501
task-comm-12.rs \
502502
task-comm-2.rs \
503503
task-comm-9.rs \
504+
task-comm-chan-nil.rs \
504505
task-life-0.rs \
505506
alt-type-simple.rs \
506507
many.rs)

src/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ TASK_XFAILS := test/run-pass/task-comm-8.rs \
434434
test/run-pass/task-comm-12.rs \
435435
test/run-pass/task-comm-2.rs \
436436
test/run-pass/task-comm-9.rs \
437+
test/run-pass/task-comm-chan-nil.rs \
437438
test/run-pass/task-life-0.rs \
438439
test/run-pass/alt-type-simple.rs \
439440
test/run-pass/many.rs
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// -*- rust -*-
2+
3+
// rustboot can't transmit nils across channels because they don't have
4+
// any size, but rustc currently can because they do have size. Whether
5+
// or not this is desirable I don't know, but here's a regression test.
6+
7+
impure fn main() {
8+
let port[()] po = port();
9+
let chan[()] ch = chan(po);
10+
11+
ch <| ();
12+
13+
let () n;
14+
n <- po;
15+
16+
check (n == ());
17+
}

0 commit comments

Comments
 (0)