rust/src/test/run-pass/move-arg-2.rs

11 lines
211 B
Rust
Raw Normal View History

fn test(-foo: @~[int]) { assert (foo[0] == 10); }
fn main() {
let x = @~[10];
// Test forgetting a local by move-in
2012-09-19 00:45:24 -05:00
test(move x);
// Test forgetting a temporary by move-in.
test(@~[10]);
}