2011-09-09 15:25:06 -05:00
|
|
|
// xfail-win32
|
2011-09-07 19:01:24 -05:00
|
|
|
use std;
|
|
|
|
|
2012-08-15 20:46:55 -05:00
|
|
|
struct complainer {
|
2012-08-15 16:10:46 -05:00
|
|
|
let c: comm::Chan<bool>;
|
|
|
|
new(c: comm::Chan<bool>) {
|
2012-08-22 19:24:52 -05:00
|
|
|
error!("Hello!");
|
2012-06-01 16:48:02 -05:00
|
|
|
self.c = c; }
|
2012-08-22 19:24:52 -05:00
|
|
|
drop { error!("About to send!");
|
2012-06-01 16:48:02 -05:00
|
|
|
comm::send(self.c, true);
|
2012-08-22 19:24:52 -05:00
|
|
|
error!("Sent!"); }
|
2011-09-07 19:01:24 -05:00
|
|
|
}
|
|
|
|
|
2012-08-15 16:10:46 -05:00
|
|
|
fn f(c: comm::Chan<bool>) {
|
2012-06-01 16:48:02 -05:00
|
|
|
let _c <- complainer(c);
|
2011-09-07 19:01:24 -05:00
|
|
|
fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-08-27 16:22:25 -05:00
|
|
|
let p = comm::Port();
|
|
|
|
let c = comm::Chan(p);
|
2012-07-23 14:53:18 -05:00
|
|
|
task::spawn_unlinked(|| f(c) );
|
2012-08-22 19:24:52 -05:00
|
|
|
error!("hiiiiiiiii");
|
2011-09-07 19:01:24 -05:00
|
|
|
assert comm::recv(p);
|
2012-07-23 14:53:18 -05:00
|
|
|
}
|