为什么{amp; mut [T]没有实现MutableSlice::slice_mut?
每晚0.12.0测试rustc(b2d4eb186 2014-10-02 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);
}
答案 0 :(得分:2)
该方法had been removed,但the change has since been rolled back。 sort
函数compiles right now的第二行。