From b3aa1a6d4ac88f68e036a05fdf19be63b522b65d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 8 Jul 2015 08:33:13 -0700 Subject: std: Deprecate a number of unstable features Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset --- src/libcollections/slice.rs | 6 ++++++ src/libcollections/str.rs | 5 +++++ src/libcollections/vec.rs | 4 ++++ 3 files changed, 15 insertions(+) (limited to 'src/libcollections') diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 4378d0804df..00a0432956b 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -762,12 +762,16 @@ impl [T] { /// Find the first index containing a matching value. #[unstable(feature = "slice_position_elem")] + #[deprecated(since = "1.3.0", + reason = "less idiomatic than .iter().position()")] pub fn position_elem(&self, t: &T) -> Option where T: PartialEq { core_slice::SliceExt::position_elem(self, t) } /// Find the last index containing a matching value. #[unstable(feature = "slice_position_elem")] + #[deprecated(since = "1.3.0", + reason = "less idiomatic than .iter().rev().position()")] pub fn rposition_elem(&self, t: &T) -> Option where T: PartialEq { core_slice::SliceExt::rposition_elem(self, t) } @@ -1009,6 +1013,8 @@ impl [T] { /// ``` #[unstable(feature = "move_from", reason = "uncertain about this API approach")] + #[deprecated(since = "1.3.0", + reason = "unclear that it must belong in the standard library")] #[inline] pub fn move_from(&mut self, mut src: Vec, start: usize, end: usize) -> usize { for (a, b) in self.iter_mut().zip(&mut src[start .. end]) { diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 25a3441fd5b..5b91475a28b 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -552,6 +552,9 @@ impl str { /// ``` #[unstable(feature = "slice_chars", reason = "may have yet to prove its worth")] + #[deprecated(since = "1.3.0", + reason = "can be implemented with char_indices and \ + hasn't seen enough use to justify inclusion")] pub fn slice_chars(&self, begin: usize, end: usize) -> &str { core_str::StrExt::slice_chars(self, begin, end) } @@ -1642,6 +1645,8 @@ impl str { /// ``` #[unstable(feature = "subslice_offset", reason = "awaiting convention about comparability of arbitrary slices")] + #[deprecated(since = "1.3.0", + reason = "replaced with other pattern-related methods")] pub fn subslice_offset(&self, inner: &str) -> usize { core_str::StrExt::subslice_offset(self, inner) } diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 007de408efe..e9f3651d63b 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -772,6 +772,9 @@ impl Vec { /// ``` #[unstable(feature = "map_in_place", reason = "API may change to provide stronger guarantees")] + #[deprecated(since = "1.3.0", + reason = "unclear that the API is strong enough and did \ + not proven itself")] pub fn map_in_place(self, mut f: F) -> Vec where F: FnMut(T) -> U { // FIXME: Assert statically that the types `T` and `U` have the same // size. @@ -1627,6 +1630,7 @@ impl IntoIter { #[inline] /// Drops all items that have not yet been moved and returns the empty vector. #[unstable(feature = "iter_to_vec")] + #[deprecated(since = "1.3.0", reason = "replaced by drain()")] pub fn into_inner(mut self) -> Vec { unsafe { for _x in self.by_ref() { } -- cgit 1.4.1-3-g733a5