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

11 lines
207 B
Rust
Raw Normal View History

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