2011-09-09 15:25:06 -05:00
|
|
|
// xfail-win32
|
2012-09-11 19:46:20 -05:00
|
|
|
extern mod std;
|
2011-09-07 19:01:24 -05:00
|
|
|
|
2012-08-15 20:46:55 -05:00
|
|
|
struct complainer {
|
2012-09-06 21:40:15 -05:00
|
|
|
c: comm::Chan<bool>,
|
2012-11-14 00:22:37 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
impl complainer : Drop {
|
2012-11-28 17:42:16 -06:00
|
|
|
fn finalize(&self) {
|
2012-11-14 00:22:37 -06:00
|
|
|
error!("About to send!");
|
|
|
|
comm::send(self.c, true);
|
|
|
|
error!("Sent!");
|
|
|
|
}
|
2011-09-07 19:01:24 -05:00
|
|
|
}
|
|
|
|
|
2012-09-05 17:58:43 -05:00
|
|
|
fn complainer(c: comm::Chan<bool>) -> complainer {
|
|
|
|
error!("Hello!");
|
|
|
|
complainer {
|
|
|
|
c: c
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-15 16:10:46 -05:00
|
|
|
fn f(c: comm::Chan<bool>) {
|
2012-10-23 13:11:23 -05:00
|
|
|
let _c = move 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();
|
2012-10-03 16:38:01 -05:00
|
|
|
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
|
|
|
}
|