diff options
| author | bors <bors@rust-lang.org> | 2015-07-28 01:12:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-07-28 01:12:39 +0000 |
| commit | 9ca511cf63c3611ffae9218945724c1b32025688 (patch) | |
| tree | 78e591245c73569b292ba9aba10facbec7252619 /src/libstd | |
| parent | 8b835572b9beacbb4c8faea2bf2943ac3a58977b (diff) | |
| parent | b3aa1a6d4ac88f68e036a05fdf19be63b522b65d (diff) | |
| download | rust-9ca511cf63c3611ffae9218945724c1b32025688.tar.gz rust-9ca511cf63c3611ffae9218945724c1b32025688.zip | |
Auto merge of #26914 - alexcrichton:deprecate-easy, r=aturon
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: * box_heap * 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
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ascii.rs | 9 | ||||
| -rw-r--r-- | src/libstd/env.rs | 2 | ||||
| -rw-r--r-- | src/libstd/fs.rs | 3 | ||||
| -rw-r--r-- | src/libstd/io/buffered.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 1 | ||||
| -rw-r--r-- | src/libstd/path.rs | 5 |
7 files changed, 19 insertions, 5 deletions
diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index cf78fa7b69a..ac98282ebb8 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -20,6 +20,9 @@ use mem; /// Extension methods for ASCII-subset only operations on owned strings #[unstable(feature = "owned_ascii_ext", reason = "would prefer to do this in a more general way")] +#[deprecated(since = "1.3.0", + reason = "hasn't yet proved essential to be in the standard library")] +#[allow(deprecated)] pub trait OwnedAsciiExt { /// Converts the string to ASCII upper case: /// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z', @@ -164,11 +167,13 @@ impl AsciiExt for str { } #[inline] + #[allow(deprecated)] fn to_ascii_uppercase(&self) -> String { self.to_string().into_ascii_uppercase() } #[inline] + #[allow(deprecated)] fn to_ascii_lowercase(&self) -> String { self.to_string().into_ascii_lowercase() } @@ -189,6 +194,7 @@ impl AsciiExt for str { } } +#[allow(deprecated)] impl OwnedAsciiExt for String { #[inline] fn into_ascii_uppercase(self) -> String { @@ -212,11 +218,13 @@ impl AsciiExt for [u8] { } #[inline] + #[allow(deprecated)] fn to_ascii_uppercase(&self) -> Vec<u8> { self.to_vec().into_ascii_uppercase() } #[inline] + #[allow(deprecated)] fn to_ascii_lowercase(&self) -> Vec<u8> { self.to_vec().into_ascii_lowercase() } @@ -242,6 +250,7 @@ impl AsciiExt for [u8] { } } +#[allow(deprecated)] impl OwnedAsciiExt for Vec<u8> { #[inline] fn into_ascii_uppercase(mut self) -> Vec<u8> { diff --git a/src/libstd/env.rs b/src/libstd/env.rs index 6842de56d21..d1a49da461e 100644 --- a/src/libstd/env.rs +++ b/src/libstd/env.rs @@ -590,6 +590,8 @@ impl ExactSizeIterator for ArgsOs { /// Returns the page size of the current architecture in bytes. #[unstable(feature = "page_size", reason = "naming and/or location may change")] +#[deprecated(since = "1.3.0", + reason = "hasn't seen enough usage to justify inclusion")] pub fn page_size() -> usize { os_imp::page_size() } diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index e5f2fcbae83..a879c2ebd73 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -1225,6 +1225,9 @@ impl PathExt for Path { reason = "the argument type of u64 is not quite appropriate for \ this function and may change if the standard library \ gains a type to represent a moment in time")] +#[deprecated(since = "1.3.0", + reason = "will never be stabilized as-is and its replacement will \ + likely have a totally new API")] pub fn set_file_times<P: AsRef<Path>>(path: P, accessed: u64, modified: u64) -> io::Result<()> { fs_imp::utimes(path.as_ref(), accessed, modified) diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index c25aa35ffbe..29d1fe19adf 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -747,7 +747,7 @@ impl<W: Write> LineWriter<W> { #[stable(feature = "rust1", since = "1.0.0")] impl<W: Write> Write for LineWriter<W> { fn write(&mut self, buf: &[u8]) -> io::Result<usize> { - match buf.rposition_elem(&b'\n') { + match buf.iter().rposition(|b| *b == b'\n') { Some(i) => { let n = try!(self.inner.write(&buf[..i + 1])); if n != i + 1 { return Ok(n) } diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index fbdfdeaaef4..ffdd75b0e6e 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1105,7 +1105,7 @@ fn read_until<R: BufRead + ?Sized>(r: &mut R, delim: u8, buf: &mut Vec<u8>) Err(ref e) if e.kind() == ErrorKind::Interrupted => continue, Err(e) => return Err(e) }; - match available.position_elem(&delim) { + match available.iter().position(|x| *x == delim) { Some(i) => { buf.push_all(&available[..i + 1]); (true, i + 1) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 440e3a26f6b..4297bbffbdf 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -232,7 +232,6 @@ #![feature(linkage, thread_local, asm)] #![feature(macro_reexport)] #![feature(slice_concat_ext)] -#![feature(slice_position_elem)] #![feature(no_std)] #![feature(oom)] #![feature(optin_builtin_traits)] diff --git a/src/libstd/path.rs b/src/libstd/path.rs index d3573345afb..f5f8508e9aa 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -200,7 +200,7 @@ mod platform { return Some(VerbatimUNC(server, share)); } else { // \\?\path - let idx = path.position_elem(&b'\\'); + let idx = path.iter().position(|&b| b == b'\\'); if idx == Some(2) && path[1] == b':' { let c = path[0]; if c.is_ascii() && (c as char).is_alphabetic() { @@ -214,7 +214,8 @@ mod platform { } else if path.starts_with(b".\\") { // \\.\path path = &path[2..]; - let slice = &path[.. path.position_elem(&b'\\').unwrap_or(path.len())]; + let pos = path.iter().position(|&b| b == b'\\'); + let slice = &path[..pos.unwrap_or(path.len())]; return Some(DeviceNS(u8_slice_as_os_str(slice))); } match parse_two_comps(path, is_sep_byte) { |
