Skip to content

Commit e0d6486

Browse files
committed
auto merge of #6780 : june0cho/rust/issue5984, r=brson
Fix #5984. Also, I found a problem on type inference and left a comment.
2 parents c8c60f0 + 56a2e5d commit e0d6486

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/libstd/vec.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -2346,12 +2346,19 @@ impl<T:Eq> OwnedEqVector<T> for ~[T] {
23462346
}
23472347
}
23482348

2349-
pub trait MutableVector<T> {
2349+
pub trait MutableVector<'self, T> {
2350+
fn mut_slice(&mut self, start: uint, end: uint) -> &'self mut [T];
2351+
23502352
unsafe fn unsafe_mut_ref(&self, index: uint) -> *mut T;
23512353
unsafe fn unsafe_set(&self, index: uint, val: T);
23522354
}
23532355

2354-
impl<'self,T> MutableVector<T> for &'self mut [T] {
2356+
impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
2357+
#[inline]
2358+
fn mut_slice(&mut self, start: uint, end: uint) -> &'self mut [T] {
2359+
mut_slice(*self, start, end)
2360+
}
2361+
23552362
#[inline(always)]
23562363
unsafe fn unsafe_mut_ref(&self, index: uint) -> *mut T {
23572364
let pair_ptr: &(*mut T, uint) = transmute(self);

0 commit comments

Comments
 (0)