Skip to content

Commit ad775be

Browse files
committed
auto merge of #14360 : alexcrichton/rust/remove-deprecated, r=kballard
These have all been deprecated for awhile now, so it's likely time to start removing them.
2 parents 9e244d7 + 33573bc commit ad775be

File tree

26 files changed

+70
-521
lines changed

26 files changed

+70
-521
lines changed

src/libcollections/bitv.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use std::cmp;
1515
use std::iter::RandomAccessIterator;
16-
use std::iter::{Rev, Enumerate, Repeat, Map, Zip};
16+
use std::iter::{Enumerate, Repeat, Map, Zip};
1717
use std::ops;
1818
use std::slice;
1919
use std::strbuf::StrBuf;
@@ -466,12 +466,6 @@ impl Bitv {
466466
Bits {bitv: self, next_idx: 0, end_idx: self.nbits}
467467
}
468468

469-
#[inline]
470-
#[deprecated = "replaced by .iter().rev()"]
471-
pub fn rev_iter<'a>(&'a self) -> Rev<Bits<'a>> {
472-
self.iter().rev()
473-
}
474-
475469
/// Returns `true` if all bits are 0
476470
pub fn none(&self) -> bool {
477471
match self.rep {

src/libcollections/dlist.rs

-19
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// Backlinks over DList::prev are raw pointers that form a full chain in
2222
// the reverse direction.
2323

24-
use std::iter::Rev;
2524
use std::iter;
2625
use std::mem;
2726
use std::ptr;
@@ -369,12 +368,6 @@ impl<T> DList<T> {
369368
Items{nelem: self.len(), head: &self.list_head, tail: self.list_tail}
370369
}
371370

372-
#[inline]
373-
#[deprecated = "replaced by .iter().rev()"]
374-
pub fn rev_iter<'a>(&'a self) -> Rev<Items<'a, T>> {
375-
self.iter().rev()
376-
}
377-
378371
/// Provide a forward iterator with mutable references
379372
#[inline]
380373
pub fn mut_iter<'a>(&'a mut self) -> MutItems<'a, T> {
@@ -390,24 +383,12 @@ impl<T> DList<T> {
390383
}
391384
}
392385

393-
#[inline]
394-
#[deprecated = "replaced by .mut_iter().rev()"]
395-
pub fn mut_rev_iter<'a>(&'a mut self) -> Rev<MutItems<'a, T>> {
396-
self.mut_iter().rev()
397-
}
398-
399386

400387
/// Consume the list into an iterator yielding elements by value
401388
#[inline]
402389
pub fn move_iter(self) -> MoveItems<T> {
403390
MoveItems{list: self}
404391
}
405-
406-
#[inline]
407-
#[deprecated = "replaced by .move_iter().rev()"]
408-
pub fn move_rev_iter(self) -> Rev<MoveItems<T>> {
409-
self.move_iter().rev()
410-
}
411392
}
412393

413394
impl<T: TotalOrd> DList<T> {

src/libcollections/ringbuf.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! collections::deque::Deque`.
1515
1616
use std::cmp;
17-
use std::iter::{Rev, RandomAccessIterator};
17+
use std::iter::RandomAccessIterator;
1818

1919
use deque::Deque;
2020

@@ -190,11 +190,6 @@ impl<T> RingBuf<T> {
190190
Items{index: 0, rindex: self.nelts, lo: self.lo, elts: self.elts.as_slice()}
191191
}
192192

193-
#[deprecated = "replaced by .iter().rev()"]
194-
pub fn rev_iter<'a>(&'a self) -> Rev<Items<'a, T>> {
195-
self.iter().rev()
196-
}
197-
198193
/// Front-to-back iterator which returns mutable values.
199194
pub fn mut_iter<'a>(&'a mut self) -> MutItems<'a, T> {
200195
let start_index = raw_index(self.lo, self.elts.len(), 0);
@@ -220,11 +215,6 @@ impl<T> RingBuf<T> {
220215
nelts: self.nelts }
221216
}
222217
}
223-
224-
#[deprecated = "replaced by .mut_iter().rev()"]
225-
pub fn mut_rev_iter<'a>(&'a mut self) -> Rev<MutItems<'a, T>> {
226-
self.mut_iter().rev()
227-
}
228218
}
229219

230220
/// RingBuf iterator

src/libcollections/smallintmap.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#![allow(missing_doc)]
1717

18-
use std::iter::{Enumerate, FilterMap, Rev};
18+
use std::iter::{Enumerate, FilterMap};
1919
use std::mem::replace;
2020
use std::{vec, slice};
2121

@@ -142,16 +142,6 @@ impl<V> SmallIntMap<V> {
142142
}
143143
}
144144

145-
#[deprecated = "replaced by .iter().rev()"]
146-
pub fn rev_iter<'r>(&'r self) -> Rev<Entries<'r, V>> {
147-
self.iter().rev()
148-
}
149-
150-
#[deprecated = "replaced by .mut_iter().rev()"]
151-
pub fn mut_rev_iter<'r>(&'r mut self) -> Rev<MutEntries<'r, V>> {
152-
self.mut_iter().rev()
153-
}
154-
155145
/// Empties the hash map, moving all values into the specified closure
156146
pub fn move_iter(&mut self)
157147
-> FilterMap<(uint, Option<V>), (uint, V),
@@ -243,8 +233,6 @@ pub struct Entries<'a, T> {
243233

244234
iterator!(impl Entries -> (uint, &'a T), get_ref)
245235
double_ended_iterator!(impl Entries -> (uint, &'a T), get_ref)
246-
#[deprecated = "replaced by Rev<Entries<'a, T>>"]
247-
pub type RevEntries<'a, T> = Rev<Entries<'a, T>>;
248236

249237
pub struct MutEntries<'a, T> {
250238
front: uint,
@@ -254,8 +242,6 @@ pub struct MutEntries<'a, T> {
254242

255243
iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
256244
double_ended_iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
257-
#[deprecated = "replaced by Rev<MutEntries<'a, T>"]
258-
pub type RevMutEntries<'a, T> = Rev<MutEntries<'a, T>>;
259245

260246
#[cfg(test)]
261247
mod test_map {

src/libcore/slice.rs

-35
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,6 @@ pub trait ImmutableVector<'a, T> {
386386
fn slice_to(&self, end: uint) -> &'a [T];
387387
/// Returns an iterator over the vector
388388
fn iter(self) -> Items<'a, T>;
389-
/// Returns a reversed iterator over a vector
390-
#[deprecated = "replaced by .iter().rev()"]
391-
fn rev_iter(self) -> Rev<Items<'a, T>>;
392389
/// Returns an iterator over the subslices of the vector which are
393390
/// separated by elements that match `pred`. The matched element
394391
/// is not contained in the subslices.
@@ -399,12 +396,6 @@ pub trait ImmutableVector<'a, T> {
399396
/// the subslices.
400397
fn splitn(self, n: uint, pred: |&T|: 'a -> bool) -> SplitsN<'a, T>;
401398
/// Returns an iterator over the subslices of the vector which are
402-
/// separated by elements that match `pred`. This starts at the
403-
/// end of the vector and works backwards. The matched element is
404-
/// not contained in the subslices.
405-
#[deprecated = "replaced by .split(pred).rev()"]
406-
fn rsplit(self, pred: |&T|: 'a -> bool) -> Rev<Splits<'a, T>>;
407-
/// Returns an iterator over the subslices of the vector which are
408399
/// separated by elements that match `pred` limited to splitting
409400
/// at most `n` times. This starts at the end of the vector and
410401
/// works backwards. The matched element is not contained in the
@@ -580,12 +571,6 @@ impl<'a,T> ImmutableVector<'a, T> for &'a [T] {
580571
}
581572
}
582573

583-
#[inline]
584-
#[deprecated = "replaced by .iter().rev()"]
585-
fn rev_iter(self) -> Rev<Items<'a, T>> {
586-
self.iter().rev()
587-
}
588-
589574
#[inline]
590575
fn split(self, pred: |&T|: 'a -> bool) -> Splits<'a, T> {
591576
Splits {
@@ -604,12 +589,6 @@ impl<'a,T> ImmutableVector<'a, T> for &'a [T] {
604589
}
605590
}
606591

607-
#[inline]
608-
#[deprecated = "replaced by .split(pred).rev()"]
609-
fn rsplit(self, pred: |&T|: 'a -> bool) -> Rev<Splits<'a, T>> {
610-
self.split(pred).rev()
611-
}
612-
613592
#[inline]
614593
fn rsplitn(self, n: uint, pred: |&T|: 'a -> bool) -> SplitsN<'a, T> {
615594
SplitsN {
@@ -806,10 +785,6 @@ pub trait MutableVector<'a, T> {
806785
/// Returns a mutable pointer to the last item in the vector.
807786
fn mut_last(self) -> Option<&'a mut T>;
808787

809-
/// Returns a reversed iterator that allows modifying each value
810-
#[deprecated = "replaced by .mut_iter().rev()"]
811-
fn mut_rev_iter(self) -> Rev<MutItems<'a, T>>;
812-
813788
/// Returns an iterator over the mutable subslices of the vector
814789
/// which are separated by elements that match `pred`. The
815790
/// matched element is not contained in the subslices.
@@ -1045,12 +1020,6 @@ impl<'a,T> MutableVector<'a, T> for &'a mut [T] {
10451020
Some(&mut self[len - 1])
10461021
}
10471022

1048-
#[inline]
1049-
#[deprecated = "replaced by .mut_iter().rev()"]
1050-
fn mut_rev_iter(self) -> Rev<MutItems<'a, T>> {
1051-
self.mut_iter().rev()
1052-
}
1053-
10541023
#[inline]
10551024
fn mut_split(self, pred: |&T|: 'a -> bool) -> MutSplits<'a, T> {
10561025
MutSplits { v: self, pred: pred, finished: false }
@@ -1354,8 +1323,6 @@ impl<'a, T> RandomAccessIterator<&'a T> for Items<'a, T> {
13541323
}
13551324

13561325
iterator!{struct Items -> *T, &'a T}
1357-
#[deprecated = "replaced by Rev<Items<'a, T>>"]
1358-
pub type RevItems<'a, T> = Rev<Items<'a, T>>;
13591326

13601327
impl<'a, T> ExactSize<&'a T> for Items<'a, T> {}
13611328
impl<'a, T> ExactSize<&'a mut T> for MutItems<'a, T> {}
@@ -1365,8 +1332,6 @@ impl<'a, T> Clone for Items<'a, T> {
13651332
}
13661333

13671334
iterator!{struct MutItems -> *mut T, &'a mut T}
1368-
#[deprecated = "replaced by Rev<MutItems<'a, T>>"]
1369-
pub type RevMutItems<'a, T> = Rev<MutItems<'a, T>>;
13701335

13711336
/// An iterator over the subslices of the vector which are separated
13721337
/// by elements that match `pred`.

src/libcore/str.rs

+1-53
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use cmp::{Eq, TotalEq};
2020
use container::Container;
2121
use default::Default;
2222
use iter::{Filter, Map, Iterator};
23-
use iter::{Rev, DoubleEndedIterator, ExactSize};
23+
use iter::{DoubleEndedIterator, ExactSize};
2424
use iter::range;
2525
use num::Saturating;
2626
use option::{None, Option, Some};
@@ -174,20 +174,11 @@ impl<'a> DoubleEndedIterator<(uint, char)> for CharOffsets<'a> {
174174
}
175175
}
176176

177-
#[deprecated = "replaced by Rev<Chars<'a>>"]
178-
pub type RevChars<'a> = Rev<Chars<'a>>;
179-
180-
#[deprecated = "replaced by Rev<CharOffsets<'a>>"]
181-
pub type RevCharOffsets<'a> = Rev<CharOffsets<'a>>;
182-
183177
/// External iterator for a string's bytes.
184178
/// Use with the `std::iter` module.
185179
pub type Bytes<'a> =
186180
Map<'a, &'a u8, u8, slice::Items<'a, u8>>;
187181

188-
#[deprecated = "replaced by Rev<Bytes<'a>>"]
189-
pub type RevBytes<'a> = Rev<Bytes<'a>>;
190-
191182
/// An iterator over the substrings of a string, separated by `sep`.
192183
#[deriving(Clone)]
193184
pub struct CharSplits<'a, Sep> {
@@ -200,9 +191,6 @@ pub struct CharSplits<'a, Sep> {
200191
finished: bool,
201192
}
202193

203-
#[deprecated = "replaced by Rev<CharSplits<'a, Sep>>"]
204-
pub type RevCharSplits<'a, Sep> = Rev<CharSplits<'a, Sep>>;
205-
206194
/// An iterator over the substrings of a string, separated by `sep`,
207195
/// splitting at most `count` times.
208196
#[deriving(Clone)]
@@ -1032,24 +1020,12 @@ pub trait StrSlice<'a> {
10321020
/// ```
10331021
fn chars(&self) -> Chars<'a>;
10341022

1035-
/// Do not use this - it is deprecated.
1036-
#[deprecated = "replaced by .chars().rev()"]
1037-
fn chars_rev(&self) -> Rev<Chars<'a>>;
1038-
10391023
/// An iterator over the bytes of `self`
10401024
fn bytes(&self) -> Bytes<'a>;
10411025

1042-
/// Do not use this - it is deprecated.
1043-
#[deprecated = "replaced by .bytes().rev()"]
1044-
fn bytes_rev(&self) -> Rev<Bytes<'a>>;
1045-
10461026
/// An iterator over the characters of `self` and their byte offsets.
10471027
fn char_indices(&self) -> CharOffsets<'a>;
10481028

1049-
/// Do not use this - it is deprecated.
1050-
#[deprecated = "replaced by .char_indices().rev()"]
1051-
fn char_indices_rev(&self) -> Rev<CharOffsets<'a>>;
1052-
10531029
/// An iterator over substrings of `self`, separated by characters
10541030
/// matched by `sep`.
10551031
///
@@ -1120,10 +1096,6 @@ pub trait StrSlice<'a> {
11201096
/// ```
11211097
fn split_terminator<Sep: CharEq>(&self, sep: Sep) -> CharSplits<'a, Sep>;
11221098

1123-
/// Do not use this - it is deprecated.
1124-
#[deprecated = "replaced by .split(sep).rev()"]
1125-
fn rsplit<Sep: CharEq>(&self, sep: Sep) -> Rev<CharSplits<'a, Sep>>;
1126-
11271099
/// An iterator over substrings of `self`, separated by characters
11281100
/// matched by `sep`, starting from the end of the string.
11291101
/// Restricted to splitting at most `count` times.
@@ -1642,34 +1614,16 @@ impl<'a> StrSlice<'a> for &'a str {
16421614
Chars{string: *self}
16431615
}
16441616

1645-
#[inline]
1646-
#[deprecated = "replaced by .chars().rev()"]
1647-
fn chars_rev(&self) -> RevChars<'a> {
1648-
self.chars().rev()
1649-
}
1650-
16511617
#[inline]
16521618
fn bytes(&self) -> Bytes<'a> {
16531619
self.as_bytes().iter().map(|&b| b)
16541620
}
16551621

1656-
#[inline]
1657-
#[deprecated = "replaced by .bytes().rev()"]
1658-
fn bytes_rev(&self) -> RevBytes<'a> {
1659-
self.bytes().rev()
1660-
}
1661-
16621622
#[inline]
16631623
fn char_indices(&self) -> CharOffsets<'a> {
16641624
CharOffsets{string: *self, iter: self.chars()}
16651625
}
16661626

1667-
#[inline]
1668-
#[deprecated = "replaced by .char_indices().rev()"]
1669-
fn char_indices_rev(&self) -> RevCharOffsets<'a> {
1670-
self.char_indices().rev()
1671-
}
1672-
16731627
#[inline]
16741628
fn split<Sep: CharEq>(&self, sep: Sep) -> CharSplits<'a, Sep> {
16751629
CharSplits {
@@ -1700,12 +1654,6 @@ impl<'a> StrSlice<'a> for &'a str {
17001654
}
17011655
}
17021656

1703-
#[inline]
1704-
#[deprecated = "replaced by .split(sep).rev()"]
1705-
fn rsplit<Sep: CharEq>(&self, sep: Sep) -> RevCharSplits<'a, Sep> {
1706-
self.split(sep).rev()
1707-
}
1708-
17091657
#[inline]
17101658
fn rsplitn<Sep: CharEq>(&self, sep: Sep, count: uint)
17111659
-> CharSplitsN<'a, Sep> {

src/librand/lib.rs

-23
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,6 @@ pub trait Rng {
323323
}
324324
}
325325

326-
/// Shuffle a mutable slice in place.
327-
#[deprecated="renamed to `.shuffle`"]
328-
fn shuffle_mut<T>(&mut self, values: &mut [T]) {
329-
self.shuffle(values)
330-
}
331-
332326
/// Randomly sample up to `n` elements from an iterator.
333327
///
334328
/// # Example
@@ -387,23 +381,6 @@ pub trait SeedableRng<Seed>: Rng {
387381
fn from_seed(seed: Seed) -> Self;
388382
}
389383

390-
/// Create a random number generator with a default algorithm and seed.
391-
///
392-
/// It returns the strongest `Rng` algorithm currently implemented in
393-
/// pure Rust. If you require a specifically seeded `Rng` for
394-
/// consistency over time you should pick one algorithm and create the
395-
/// `Rng` yourself.
396-
///
397-
/// This is a very expensive operation as it has to read randomness
398-
/// from the operating system and use this in an expensive seeding
399-
/// operation. If one does not require high performance generation of
400-
/// random numbers, `task_rng` and/or `random` may be more
401-
/// appropriate.
402-
#[deprecated="use `task_rng` or `StdRng::new`"]
403-
pub fn rng() -> StdRng {
404-
StdRng::new().unwrap()
405-
}
406-
407384
/// The standard RNG. This is designed to be efficient on the current
408385
/// platform.
409386
#[cfg(not(target_word_size="64"))]

0 commit comments

Comments
 (0)