Skip to content

Commit 554946c

Browse files
committed
rollup merge of #23873: alexcrichton/remove-deprecated
Conflicts: src/libcollectionstest/fmt.rs src/libcollectionstest/lib.rs src/libcollectionstest/str.rs src/libcore/error.rs src/libstd/fs.rs src/libstd/io/cursor.rs src/libstd/os.rs src/libstd/process.rs src/libtest/lib.rs src/test/run-pass-fulldeps/compiler-calls.rs
2 parents e10ee2c + d4a2c94 commit 554946c

File tree

166 files changed

+641
-3982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+641
-3982
lines changed

mk/tests.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ $(foreach file,$(wildcard $(S)src/doc/trpl/*.md), \
166166
######################################################################
167167

168168
# The main testing target. Tests lots of stuff.
169-
check: cleantmptestlogs cleantestlibs all check-stage2 tidy
169+
check: check-sanitycheck cleantmptestlogs cleantestlibs all check-stage2 tidy
170170
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
171171

172172
# As above but don't bother running tidy.
@@ -193,6 +193,11 @@ check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
193193
# Not run as part of the normal test suite, but tested by bors on checkin.
194194
check-secondary: check-build-compiletest check-build-lexer-verifier check-lexer check-pretty
195195

196+
.PHONY: check-sanitycheck
197+
198+
check-sanitycheck:
199+
$(Q)$(CFG_PYTHON) $(S)src/etc/check-sanitycheck.py
200+
196201
# check + check-secondary.
197202
#
198203
# Issue #17883: build check-secondary first so hidden dependencies in

src/doc/reference.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -977,17 +977,13 @@ An example of `use` declarations:
977977

978978
```
979979
# #![feature(core)]
980-
use std::iter::range_step;
981980
use std::option::Option::{Some, None};
982981
use std::collections::hash_map::{self, HashMap};
983982
984983
fn foo<T>(_: T){}
985984
fn bar(map1: HashMap<String, usize>, map2: hash_map::HashMap<String, usize>){}
986985
987986
fn main() {
988-
// Equivalent to 'std::iter::range_step(0, 10, 2);'
989-
range_step(0, 10, 2);
990-
991987
// Equivalent to 'foo(vec![std::option::Option::Some(1.0f64),
992988
// std::option::Option::None]);'
993989
foo(vec![Some(1.0f64), None]);

src/doc/trpl/iterators.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,12 @@ for num in nums.iter() {
243243
```
244244

245245
These two basic iterators should serve you well. There are some more
246-
advanced iterators, including ones that are infinite. Like `count`:
246+
advanced iterators, including ones that are infinite. Like using range syntax
247+
and `step_by`:
247248

248249
```rust
249-
# #![feature(core)]
250-
std::iter::count(1, 5);
250+
# #![feature(step_by)]
251+
(1..).step_by(5);
251252
```
252253

253254
This iterator counts up from one, adding five each time. It will give
@@ -292,11 +293,11 @@ just use `for` instead.
292293
There are tons of interesting iterator adapters. `take(n)` will return an
293294
iterator over the next `n` elements of the original iterator, note that this
294295
has no side effect on the original iterator. Let's try it out with our infinite
295-
iterator from before, `count()`:
296+
iterator from before:
296297

297298
```rust
298-
# #![feature(core)]
299-
for i in std::iter::count(1, 5).take(5) {
299+
# #![feature(step_by)]
300+
for i in (1..).step_by(5).take(5) {
300301
println!("{}", i);
301302
}
302303
```

src/etc/check-sanitycheck.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env python
2+
#
3+
# Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
4+
# file at the top-level directory of this distribution and at
5+
# http://rust-lang.org/COPYRIGHT.
6+
#
7+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10+
# option. This file may not be copied, modified, or distributed
11+
# except according to those terms.
12+
13+
import os
14+
import sys
15+
import functools
16+
import resource
17+
18+
STATUS = 0
19+
20+
21+
def error_unless_permitted(env_var, message):
22+
global STATUS
23+
if not os.getenv(env_var):
24+
sys.stderr.write(message)
25+
STATUS = 1
26+
27+
28+
def only_on(platforms):
29+
def decorator(func):
30+
@functools.wraps(func)
31+
def inner():
32+
if any(map(lambda x: sys.platform.startswith(x), platforms)):
33+
func()
34+
return inner
35+
return decorator
36+
37+
38+
@only_on(('linux', 'darwin', 'freebsd', 'openbsd'))
39+
def check_rlimit_core():
40+
soft, hard = resource.getrlimit(resource.RLIMIT_CORE)
41+
if soft > 0:
42+
error_unless_permitted('ALLOW_NONZERO_RLIMIT_CORE', """\
43+
RLIMIT_CORE is set to a nonzero value (%d). During debuginfo, the test suite
44+
will segfault many rustc's, creating many potentially large core files.
45+
set ALLOW_NONZERO_RLIMIT_CORE to ignore this warning
46+
""" % (soft))
47+
48+
49+
def main():
50+
check_rlimit_core()
51+
52+
if __name__ == '__main__':
53+
main()
54+
sys.exit(STATUS)

src/libcollections/bit.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
//! [sieve]: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
3939
//!
4040
//! ```
41-
//! # #![feature(collections, core)]
41+
//! # #![feature(collections, core, step_by)]
4242
//! use std::collections::{BitSet, BitVec};
4343
//! use std::num::Float;
4444
//! use std::iter;
@@ -60,7 +60,7 @@
6060
//! if bv[i] {
6161
//! // Mark all multiples of i as non-prime (any multiples below i * i
6262
//! // will have been marked as non-prime previously)
63-
//! for j in iter::range_step(i * i, max_prime, i) { bv.set(j, false) }
63+
//! for j in (i * i..max_prime).step_by(i) { bv.set(j, false) }
6464
//! }
6565
//! }
6666
//! BitSet::from_bit_vec(bv)
@@ -1264,14 +1264,6 @@ impl BitSet {
12641264
BitSet { bit_vec: bit_vec }
12651265
}
12661266

1267-
/// Deprecated: use `from_bit_vec`.
1268-
#[inline]
1269-
#[deprecated(since = "1.0.0", reason = "renamed to from_bit_vec")]
1270-
#[unstable(feature = "collections")]
1271-
pub fn from_bitv(bit_vec: BitVec) -> BitSet {
1272-
BitSet { bit_vec: bit_vec }
1273-
}
1274-
12751267
/// Returns the capacity in bits for this bit vector. Inserting any
12761268
/// element less than this amount will not trigger a resizing.
12771269
///

src/libcollections/borrow.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -248,26 +248,6 @@ impl<'a, B: ?Sized> Cow<'a, B> where B: ToOwned {
248248
Owned(owned) => owned
249249
}
250250
}
251-
252-
/// Returns true if this `Cow` wraps a borrowed value
253-
#[deprecated(since = "1.0.0", reason = "match on the enum instead")]
254-
#[unstable(feature = "std_misc")]
255-
pub fn is_borrowed(&self) -> bool {
256-
match *self {
257-
Borrowed(_) => true,
258-
_ => false,
259-
}
260-
}
261-
262-
/// Returns true if this `Cow` wraps an owned value
263-
#[deprecated(since = "1.0.0", reason = "match on the enum instead")]
264-
#[unstable(feature = "std_misc")]
265-
pub fn is_owned(&self) -> bool {
266-
match *self {
267-
Owned(_) => true,
268-
_ => false,
269-
}
270-
}
271251
}
272252

273253
#[stable(feature = "rust1", since = "1.0.0")]

src/libcollections/lib.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,6 @@ pub use string::String;
6767
pub use vec::Vec;
6868
pub use vec_map::VecMap;
6969

70-
#[deprecated(since = "1.0.0", reason = "renamed to vec_deque")]
71-
#[unstable(feature = "collections")]
72-
pub use vec_deque as ring_buf;
73-
74-
#[deprecated(since = "1.0.0", reason = "renamed to linked_list")]
75-
#[unstable(feature = "collections")]
76-
pub use linked_list as dlist;
77-
78-
#[deprecated(since = "1.0.0", reason = "renamed to bit_vec")]
79-
#[unstable(feature = "collections")]
80-
pub use bit_vec as bitv;
81-
82-
#[deprecated(since = "1.0.0", reason = "renamed to bit_set")]
83-
#[unstable(feature = "collections")]
84-
pub use bit_set as bitv_set;
85-
8670
// Needed for the vec! macro
8771
pub use alloc::boxed;
8872

@@ -107,21 +91,13 @@ pub mod vec_map;
10791
reason = "RFC 509")]
10892
pub mod bit_vec {
10993
pub use bit::{BitVec, Iter};
110-
111-
#[deprecated(since = "1.0.0", reason = "renamed to BitVec")]
112-
#[unstable(feature = "collections")]
113-
pub use bit::BitVec as Bitv;
11494
}
11595

11696
#[unstable(feature = "collections",
11797
reason = "RFC 509")]
11898
pub mod bit_set {
11999
pub use bit::{BitSet, Union, Intersection, Difference, SymmetricDifference};
120100
pub use bit::SetIter as Iter;
121-
122-
#[deprecated(since = "1.0.0", reason = "renamed to BitSet")]
123-
#[unstable(feature = "collections")]
124-
pub use bit::BitSet as BitvSet;
125101
}
126102

127103
#[stable(feature = "rust1", since = "1.0.0")]

src/libcollections/linked_list.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ use core::iter::{self, FromIterator, IntoIterator};
3232
use core::mem;
3333
use core::ptr;
3434

35-
#[deprecated(since = "1.0.0", reason = "renamed to LinkedList")]
36-
#[unstable(feature = "collections")]
37-
pub use LinkedList as DList;
38-
3935
/// A doubly-linked list.
4036
#[stable(feature = "rust1", since = "1.0.0")]
4137
pub struct LinkedList<T> {
@@ -844,7 +840,7 @@ impl<A> ExactSizeIterator for IntoIter<A> {}
844840
#[stable(feature = "rust1", since = "1.0.0")]
845841
impl<A> FromIterator<A> for LinkedList<A> {
846842
fn from_iter<T: IntoIterator<Item=A>>(iter: T) -> LinkedList<A> {
847-
let mut ret = DList::new();
843+
let mut ret = LinkedList::new();
848844
ret.extend(iter);
849845
ret
850846
}

src/libcollections/slice.rs

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ pub use core::slice::{IntSliceExt, SplitMut, ChunksMut, Split};
105105
pub use core::slice::{SplitN, RSplitN, SplitNMut, RSplitNMut};
106106
pub use core::slice::{bytes, mut_ref_slice, ref_slice};
107107
pub use core::slice::{from_raw_parts, from_raw_parts_mut};
108-
pub use core::slice::{from_raw_buf, from_raw_mut_buf};
109108

110109
////////////////////////////////////////////////////////////////////////////////
111110
// Basic slice extension methods
@@ -279,33 +278,6 @@ impl<T> [T] {
279278
cmp::min(self.len(), end-start)
280279
}
281280

282-
/// Deprecated: use `&s[start .. end]` notation instead.
283-
#[unstable(feature = "collections",
284-
reason = "will be replaced by slice syntax")]
285-
#[deprecated(since = "1.0.0", reason = "use &s[start .. end] instead")]
286-
#[inline]
287-
pub fn slice(&self, start: usize, end: usize) -> &[T] {
288-
&self[start .. end]
289-
}
290-
291-
/// Deprecated: use `&s[start..]` notation instead.
292-
#[unstable(feature = "collections",
293-
reason = "will be replaced by slice syntax")]
294-
#[deprecated(since = "1.0.0", reason = "use &s[start..] instead")]
295-
#[inline]
296-
pub fn slice_from(&self, start: usize) -> &[T] {
297-
&self[start ..]
298-
}
299-
300-
/// Deprecated: use `&s[..end]` notation instead.
301-
#[unstable(feature = "collections",
302-
reason = "will be replaced by slice syntax")]
303-
#[deprecated(since = "1.0.0", reason = "use &s[..end] instead")]
304-
#[inline]
305-
pub fn slice_to(&self, end: usize) -> &[T] {
306-
&self[.. end]
307-
}
308-
309281
/// Divides one slice into two at an index.
310282
///
311283
/// The first will contain all indices from `[0, mid)` (excluding
@@ -608,42 +580,6 @@ impl<T> [T] {
608580
core_slice::SliceExt::get_mut(self, index)
609581
}
610582

611-
/// Deprecated: use `&mut s[..]` instead.
612-
#[unstable(feature = "collections",
613-
reason = "will be replaced by slice syntax")]
614-
#[deprecated(since = "1.0.0", reason = "use &mut s[..] instead")]
615-
#[allow(deprecated)]
616-
pub fn as_mut_slice(&mut self) -> &mut [T] {
617-
core_slice::SliceExt::as_mut_slice(self)
618-
}
619-
620-
/// Deprecated: use `&mut s[start .. end]` instead.
621-
#[unstable(feature = "collections",
622-
reason = "will be replaced by slice syntax")]
623-
#[deprecated(since = "1.0.0", reason = "use &mut s[start .. end] instead")]
624-
#[inline]
625-
pub fn slice_mut(&mut self, start: usize, end: usize) -> &mut [T] {
626-
&mut self[start .. end]
627-
}
628-
629-
/// Deprecated: use `&mut s[start ..]` instead.
630-
#[unstable(feature = "collections",
631-
reason = "will be replaced by slice syntax")]
632-
#[deprecated(since = "1.0.0", reason = "use &mut s[start ..] instead")]
633-
#[inline]
634-
pub fn slice_from_mut(&mut self, start: usize) -> &mut [T] {
635-
&mut self[start ..]
636-
}
637-
638-
/// Deprecated: use `&mut s[.. end]` instead.
639-
#[unstable(feature = "collections",
640-
reason = "will be replaced by slice syntax")]
641-
#[deprecated(since = "1.0.0", reason = "use &mut s[.. end] instead")]
642-
#[inline]
643-
pub fn slice_to_mut(&mut self, end: usize) -> &mut [T] {
644-
&mut self[.. end]
645-
}
646-
647583
/// Returns an iterator that allows modifying each value
648584
#[stable(feature = "rust1", since = "1.0.0")]
649585
#[inline]
@@ -933,13 +869,6 @@ impl<T> [T] {
933869
core_slice::SliceExt::binary_search(self, x)
934870
}
935871

936-
/// Deprecated: use `binary_search` instead.
937-
#[unstable(feature = "collections")]
938-
#[deprecated(since = "1.0.0", reason = "use binary_search instead")]
939-
pub fn binary_search_elem(&self, x: &T) -> Result<usize, usize> where T: Ord {
940-
self.binary_search(x)
941-
}
942-
943872
/// Mutates the slice to the next lexicographic permutation.
944873
///
945874
/// Returns `true` if successful and `false` if the slice is at the

0 commit comments

Comments
 (0)