std: Clean out #[deprecated] APIs
This commit cleans out a large amount of deprecated APIs from the standard library and some of the facade crates as well, updating all users in the compiler and in tests as it goes along.
This commit is contained in:
parent
d754722a04
commit
d4a2c94180
166 changed files with 602 additions and 4014 deletions
|
|
@ -977,7 +977,6 @@ An example of `use` declarations:
|
|||
|
||||
```
|
||||
# #![feature(core)]
|
||||
use std::iter::range_step;
|
||||
use std::option::Option::{Some, None};
|
||||
use std::collections::hash_map::{self, HashMap};
|
||||
|
||||
|
|
@ -985,9 +984,6 @@ fn foo<T>(_: T){}
|
|||
fn bar(map1: HashMap<String, usize>, map2: hash_map::HashMap<String, usize>){}
|
||||
|
||||
fn main() {
|
||||
// Equivalent to 'std::iter::range_step(0, 10, 2);'
|
||||
range_step(0, 10, 2);
|
||||
|
||||
// Equivalent to 'foo(vec![std::option::Option::Some(1.0f64),
|
||||
// std::option::Option::None]);'
|
||||
foo(vec![Some(1.0f64), None]);
|
||||
|
|
|
|||
|
|
@ -243,11 +243,12 @@ for num in nums.iter() {
|
|||
```
|
||||
|
||||
These two basic iterators should serve you well. There are some more
|
||||
advanced iterators, including ones that are infinite. Like `count`:
|
||||
advanced iterators, including ones that are infinite. Like using range syntax
|
||||
and `step_by`:
|
||||
|
||||
```rust
|
||||
# #![feature(core)]
|
||||
std::iter::count(1, 5);
|
||||
# #![feature(step_by)]
|
||||
(1..).step_by(5);
|
||||
```
|
||||
|
||||
This iterator counts up from one, adding five each time. It will give
|
||||
|
|
@ -292,11 +293,11 @@ just use `for` instead.
|
|||
There are tons of interesting iterator adapters. `take(n)` will return an
|
||||
iterator over the next `n` elements of the original iterator, note that this
|
||||
has no side effect on the original iterator. Let's try it out with our infinite
|
||||
iterator from before, `count()`:
|
||||
iterator from before:
|
||||
|
||||
```rust
|
||||
# #![feature(core)]
|
||||
for i in std::iter::count(1, 5).take(5) {
|
||||
# #![feature(step_by)]
|
||||
for i in (1..).step_by(5).take(5) {
|
||||
println!("{}", i);
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue