mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 14:31:55 +00:00
Add a regression test for channels of nil, which happens to work in rustc, but not in rustboot
This commit is contained in:
parent
c02cdc32a8
commit
3dcb79dac9
@ -501,6 +501,7 @@ TASK_XFAILS := $(addprefix $(S)src/test/run-pass/, \
|
||||
task-comm-12.rs \
|
||||
task-comm-2.rs \
|
||||
task-comm-9.rs \
|
||||
task-comm-chan-nil.rs \
|
||||
task-life-0.rs \
|
||||
alt-type-simple.rs \
|
||||
many.rs)
|
||||
|
@ -434,6 +434,7 @@ TASK_XFAILS := test/run-pass/task-comm-8.rs \
|
||||
test/run-pass/task-comm-12.rs \
|
||||
test/run-pass/task-comm-2.rs \
|
||||
test/run-pass/task-comm-9.rs \
|
||||
test/run-pass/task-comm-chan-nil.rs \
|
||||
test/run-pass/task-life-0.rs \
|
||||
test/run-pass/alt-type-simple.rs \
|
||||
test/run-pass/many.rs
|
||||
|
17
src/test/run-pass/task-comm-chan-nil.rs
Normal file
17
src/test/run-pass/task-comm-chan-nil.rs
Normal file
@ -0,0 +1,17 @@
|
||||
// -*- rust -*-
|
||||
|
||||
// rustboot can't transmit nils across channels because they don't have
|
||||
// any size, but rustc currently can because they do have size. Whether
|
||||
// or not this is desirable I don't know, but here's a regression test.
|
||||
|
||||
impure fn main() {
|
||||
let port[()] po = port();
|
||||
let chan[()] ch = chan(po);
|
||||
|
||||
ch <| ();
|
||||
|
||||
let () n;
|
||||
n <- po;
|
||||
|
||||
check (n == ());
|
||||
}
|
Loading…
Reference in New Issue
Block a user