e08a805b30
Conflicts: src/libsyntax/parse/parser.rs src/test/bench/graph500-bfs.rs src/test/bench/sudoku.rs src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs src/test/run-pass/empty-mutable-vec.rs src/test/run-pass/foreach-nested.rs src/test/run-pass/swap-2.rs
22 lines
328 B
Rust
22 lines
328 B
Rust
trait Reverser {
|
|
fn reverse(&self);
|
|
}
|
|
|
|
impl &mut [uint] : Reverser {
|
|
fn reverse(&self) {
|
|
vec::reverse(*self);
|
|
}
|
|
}
|
|
|
|
fn bar(v: &mut [uint]) {
|
|
v.reverse();
|
|
v.reverse();
|
|
v.reverse();
|
|
}
|
|
|
|
pub fn main() {
|
|
let mut the_vec = ~[1, 2, 3, 100];
|
|
bar(the_vec);
|
|
assert the_vec == ~[100, 3, 2, 1];
|
|
}
|