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

21 lines
346 B
Rust
Raw Normal View History

// xfail-test
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()
}
pub fn main() {
let mut the_vec = ~[1, 2, 3, 100];
2013-03-28 18:39:09 -07:00
assert!(the_vec == foo(the_vec));
assert!(the_vec == bar(the_vec));
assert!(the_vec == bip(the_vec));
}