rust/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs

14 lines
260 B
Rust
Raw Normal View History

fn bar(v: &mut [uint]) -> ~[uint] {
2013-06-22 13:43:15 -05:00
v.to_owned()
}
fn bip(v: &[uint]) -> ~[uint] {
2013-06-22 13:43:15 -05:00
v.to_owned()
}
pub fn main() {
2013-06-22 13:43:15 -05:00
let mut the_vec = ~[1u, 2, 3, 100];
assert_eq!(the_vec.clone(), bar(the_vec));
assert_eq!(the_vec.clone(), bip(the_vec));
}