Skip to content

Commit 7274447

Browse files
authored
Rollup merge of #96861 - m-ou-se:std-use-prelude-2021, r=joshtriplett
Use Rust 2021 prelude in std itself.
2 parents ac97727 + 4f212f0 commit 7274447

File tree

39 files changed

+7
-43
lines changed

39 files changed

+7
-43
lines changed

library/std/src/collections/hash/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::collections::TryReserveErrorKind;
1212
use crate::fmt::{self, Debug};
1313
#[allow(deprecated)]
1414
use crate::hash::{BuildHasher, Hash, Hasher, SipHasher13};
15-
use crate::iter::{FromIterator, FusedIterator};
15+
use crate::iter::FusedIterator;
1616
use crate::ops::Index;
1717
use crate::sys;
1818

library/std/src/collections/hash/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::borrow::Borrow;
77
use crate::collections::TryReserveError;
88
use crate::fmt;
99
use crate::hash::{BuildHasher, Hash};
10-
use crate::iter::{Chain, FromIterator, FusedIterator};
10+
use crate::iter::{Chain, FusedIterator};
1111
use crate::ops::{BitAnd, BitOr, BitXor, Sub};
1212

1313
use super::map::{map_try_reserve_error, RandomState};

library/std/src/ffi/os_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::cmp;
66
use crate::collections::TryReserveError;
77
use crate::fmt;
88
use crate::hash::{Hash, Hasher};
9-
use crate::iter::{Extend, FromIterator};
9+
use crate::iter::Extend;
1010
use crate::ops;
1111
use crate::rc::Rc;
1212
use crate::str::FromStr;

library/std/src/io/cursor.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ use crate::alloc::Allocator;
77
use crate::cmp;
88
use crate::io::{self, ErrorKind, IoSlice, IoSliceMut, ReadBuf, SeekFrom};
99

10-
use core::convert::TryInto;
11-
1210
/// A `Cursor` wraps an in-memory buffer and provides it with a
1311
/// [`Seek`] implementation.
1412
///

library/std/src/io/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@
252252
mod tests;
253253

254254
use crate::cmp;
255-
use crate::convert::TryInto;
256255
use crate::fmt;
257256
use crate::mem::replace;
258257
use crate::ops::{Deref, DerefMut};

library/std/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@
343343
// to import the prelude implicitly when building crates that depend on std.
344344
#[prelude_import]
345345
#[allow(unused)]
346-
use prelude::v1::*;
346+
use prelude::rust_2021::*;
347347

348348
// Access to Bencher, etc.
349349
#[cfg(test)]

library/std/src/net/addr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
mod tests;
33

44
use crate::cmp::Ordering;
5-
use crate::convert::TryInto;
65
use crate::fmt;
76
use crate::hash;
87
use crate::io::{self, Write};

library/std/src/net/parser.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#[cfg(test)]
77
mod tests;
88

9-
use crate::convert::TryInto as _;
109
use crate::error::Error;
1110
use crate::fmt;
1211
use crate::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};

library/std/src/os/unix/net/ancillary.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use super::{sockaddr_un, SocketAddr};
2-
use crate::convert::TryFrom;
32
use crate::io::{self, IoSlice, IoSliceMut};
43
use crate::marker::PhantomData;
54
use crate::mem::{size_of, zeroed};

library/std/src/os/unix/net/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use crate::io::{self, ErrorKind, IoSlice, IoSliceMut};
1010
target_os = "netbsd",
1111
target_os = "openbsd",
1212
))]
13-
use crate::iter::FromIterator;
1413
#[cfg(any(
1514
target_os = "android",
1615
target_os = "dragonfly",

0 commit comments

Comments
 (0)