rust/src/test/run-pass/cleanup-copy-mode.rs

10 lines
199 B
Rust
Raw Normal View History

2012-02-24 19:46:13 -06:00
// xfail-win32
2012-08-01 19:30:05 -05:00
fn adder(+x: @int, +y: @int) -> int { return *x + *y; }
2012-02-24 19:46:13 -06:00
fn failer() -> @int { fail; }
fn main() {
2012-06-30 18:19:07 -05:00
assert(result::is_err(task::try(|| {
2012-02-24 19:46:13 -06:00
adder(@2, failer()); ()
})));
2012-02-24 19:46:13 -06:00
}