2
爲什麼MutableSlice::slice_mut未執行& mut [T]?slice_mut for&mut [T]
測試在rustc 0.12.0-夜間(b2d4eb186 2014年10月2日15時57分19秒0000):
fn sort<T>(v: &mut [T]){
let (l, r) = v.split_at_mut(2); // Ok
let len = v.slice_mut(1u, 3u).len(); // error: type `&mut [T]` does not implement any method in scope named `slice_mut`
}
#[test]
fn it_works() {
let mut v = [1i, 2, 3, 4, 5, 6];
sort(v);
}