rust/src/test/run-pass/coerce-reborrow-mut-vec-arg.rs

16 lines
250 B
Rust
Raw Normal View History

trait Reverser {
fn reverse(&self);
}
fn bar(v: &mut [uint]) {
vec::reverse(v);
vec::reverse(v);
vec::reverse(v);
}
pub fn main() {
let mut the_vec = ~[1, 2, 3, 100];
bar(the_vec);
2013-03-28 20:39:09 -05:00
assert!(the_vec == ~[100, 3, 2, 1]);
}