summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-05-28 19:58:52 -0700
committerbors <bors@rust-lang.org>2013-05-28 19:58:52 -0700
commite0d6486ed628cdf6e35939e7b0ccd796cbc5b6eb (patch)
tree5370da0df359ae263e95de1846bdfdd154f2bc0e /src/libstd
parentc8c60f063fafd4d41cd7d162794dca7018f7cd8a (diff)
parent56a2e5dc22bfd0791b5e71dc89dde48fd3034e03 (diff)
downloadrust-e0d6486ed628cdf6e35939e7b0ccd796cbc5b6eb.tar.gz
rust-e0d6486ed628cdf6e35939e7b0ccd796cbc5b6eb.zip
auto merge of #6780 : june0cho/rust/issue5984, r=brson
Fix #5984. Also, I found a problem on type inference and left a comment.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/vec.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index 7e73158fee4..5b5a7afcf13 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -2346,12 +2346,19 @@ impl<T:Eq> OwnedEqVector<T> for ~[T] {
     }
 }
 
-pub trait MutableVector<T> {
+pub trait MutableVector<'self, T> {
+    fn mut_slice(&mut self, start: uint, end: uint) -> &'self mut [T];
+
     unsafe fn unsafe_mut_ref(&self, index: uint) -> *mut T;
     unsafe fn unsafe_set(&self, index: uint, val: T);
 }
 
-impl<'self,T> MutableVector<T> for &'self mut [T] {
+impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
+    #[inline]
+    fn mut_slice(&mut self, start: uint, end: uint) -> &'self mut [T] {
+        mut_slice(*self, start, end)
+    }
+
     #[inline(always)]
     unsafe fn unsafe_mut_ref(&self, index: uint) -> *mut T {
         let pair_ptr: &(*mut T, uint) = transmute(self);