diff options
| author | bors <bors@rust-lang.org> | 2014-10-12 00:07:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-12 00:07:15 +0000 |
| commit | adb44f53d8cd0170930a324d514bd75fbd9a0271 (patch) | |
| tree | cb6698d4e7b4afb43569e9a4955469c6cb7b9300 | |
| parent | 519e85b8a930b252e28a834574f9b4999d656798 (diff) | |
| parent | 6e29f86bc8208909ad7b844a841dfe48502ec2bc (diff) | |
| download | rust-adb44f53d8cd0170930a324d514bd75fbd9a0271.tar.gz rust-adb44f53d8cd0170930a324d514bd75fbd9a0271.zip | |
auto merge of #17942 : JIghtuse/rust/master, r=alexcrichton
[breaking-change] Closes #17916
| -rw-r--r-- | src/libcollections/slice.rs | 12 | ||||
| -rw-r--r-- | src/libcollections/vec.rs | 7 | ||||
| -rw-r--r-- | src/libgraphviz/maybe_owned_vec.rs | 2 | ||||
| -rw-r--r-- | src/librustc/middle/traits/select.rs | 2 |
4 files changed, 9 insertions, 14 deletions
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 955a1a5068b..1cda1e93959 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -277,12 +277,14 @@ pub trait CloneableVector<T> { } /// Converts `self` into an owned vector, not making a copy if possible. + /// Deprecated. Use 'to_vec' + #[deprecated = "Replaced by `to_vec`"] fn into_vec(self) -> Vec<T>; - /// Deprecated. Use `into_vec` - #[deprecated = "Replaced by `into_vec`"] + /// Deprecated. Use `to_vec` + #[deprecated = "Replaced by `to_vec`"] fn into_owned(self) -> Vec<T> { - self.into_vec() + self.to_vec() } } @@ -2328,9 +2330,9 @@ mod tests { } #[test] - fn test_into_vec() { + fn test_to_vec() { let xs = box [1u, 2, 3]; - let ys = xs.into_vec(); + let ys = xs.to_vec(); assert_eq!(ys.as_slice(), [1u, 2, 3].as_slice()); } } diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 0933bcb8ab8..f922c189fef 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -570,13 +570,6 @@ impl<T> Collection for Vec<T> { } } -impl<T: Clone> CloneableVector<T> for Vec<T> { - #[deprecated = "call .clone() instead"] - fn to_vec(&self) -> Vec<T> { self.clone() } - #[deprecated = "move the vector instead"] - fn into_vec(self) -> Vec<T> { self } -} - // FIXME: #13996: need a way to mark the return value as `noalias` #[inline(never)] unsafe fn alloc_or_realloc<T>(ptr: *mut T, old_size: uint, size: uint) -> *mut T { diff --git a/src/libgraphviz/maybe_owned_vec.rs b/src/libgraphviz/maybe_owned_vec.rs index 50d957e1381..f67a9c2c84c 100644 --- a/src/libgraphviz/maybe_owned_vec.rs +++ b/src/libgraphviz/maybe_owned_vec.rs @@ -140,7 +140,7 @@ impl<'a,T:Clone> CloneableVector<T> for MaybeOwnedVector<'a,T> { impl<'a, T: Clone> Clone for MaybeOwnedVector<'a, T> { fn clone(&self) -> MaybeOwnedVector<'a, T> { match *self { - Growable(ref v) => Growable(v.to_vec()), + Growable(ref v) => Growable(v.clone()), Borrowed(v) => Borrowed(v) } } diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs index 305528a9af8..4040b452e99 100644 --- a/src/librustc/middle/traits/select.rs +++ b/src/librustc/middle/traits/select.rs @@ -1014,7 +1014,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ty::ty_tup(ref tys) => { // (T1, ..., Tn) -- meets any bound that all of T1...Tn meet - Ok(If(tys.to_owned())) + Ok(If(tys.clone())) } ty::ty_unboxed_closure(def_id, _) => { |
