rust/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs
Ben Striegel f08af9a7a5 RIMOV, round 5
find ./ -type f -name "*.rs" -exec sed -i "s/\&\[mut /\&mut \[/g" {} \;
2013-01-30 23:18:08 -05:00

19 lines
321 B
Rust

fn foo(v: &[const uint]) -> ~[uint] {
v.to_vec()
}
fn bar(v: &mut [uint]) -> ~[uint] {
v.to_vec()
}
fn bip(v: &[uint]) -> ~[uint] {
v.to_vec()
}
fn main() {
let mut the_vec = ~[1, 2, 3, 100];
assert the_vec == foo(the_vec);
assert the_vec == bar(the_vec);
assert the_vec == bip(the_vec);
}