rust/src/test/run-pass/move-arg-2.rs
2012-10-12 20:43:38 -07:00

11 lines
211 B
Rust

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