rust/tests/ui/coercion/coerce-reborrow-mut-vec-rcvr.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
218 B
Rust
Raw Normal View History

// run-pass
fn bar(v: &mut [usize]) {
v.reverse();
v.reverse();
v.reverse();
}
pub fn main() {
let mut the_vec = vec![1, 2, 3, 100];
bar(&mut the_vec);
2015-02-24 12:15:45 -06:00
assert_eq!(the_vec, [100, 3, 2, 1]);
}