Skip to content

Commit ad2b34d

Browse files
committed
remove some unneeded imports
1 parent 661b33f commit ad2b34d

File tree

55 files changed

+64
-135
lines changed

Some content is hidden

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

55 files changed

+64
-135
lines changed

library/alloc/benches/btree/map.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::collections::BTreeMap;
2-
use std::iter::Iterator;
32
use std::ops::RangeBounds;
43
use std::vec::Vec;
54

library/alloc/benches/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rand::RngCore;
2-
use std::iter::{repeat, FromIterator};
2+
use std::iter::repeat;
33
use test::{black_box, Bencher};
44

55
#[bench]

library/alloc/src/boxed.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,13 @@ use core::any::Any;
150150
use core::async_iter::AsyncIterator;
151151
use core::borrow;
152152
use core::cmp::Ordering;
153-
use core::convert::{From, TryFrom};
154153
use core::error::Error;
155154
use core::fmt;
156155
use core::future::Future;
157156
use core::hash::{Hash, Hasher};
158-
#[cfg(not(no_global_oom_handling))]
159-
use core::iter::FromIterator;
160-
use core::iter::{FusedIterator, Iterator};
157+
use core::iter::FusedIterator;
161158
use core::marker::Tuple;
162-
use core::marker::{Unpin, Unsize};
159+
use core::marker::Unsize;
163160
use core::mem;
164161
use core::ops::{
165162
CoerceUnsized, Deref, DerefMut, DispatchFromDyn, Generator, GeneratorState, Receiver,

library/alloc/src/collections/binary_heap/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
#![stable(feature = "rust1", since = "1.0.0")]
145145

146146
use core::fmt;
147-
use core::iter::{FromIterator, FusedIterator, InPlaceIterable, SourceIter, TrustedLen};
147+
use core::iter::{FusedIterator, InPlaceIterable, SourceIter, TrustedLen};
148148
use core::mem::{self, swap, ManuallyDrop};
149149
use core::num::NonZeroUsize;
150150
use core::ops::{Deref, DerefMut};
@@ -263,7 +263,6 @@ mod tests;
263263
/// more detailed analysis.
264264
///
265265
/// [`core::cmp::Reverse`]: core::cmp::Reverse
266-
/// [`Ord`]: core::cmp::Ord
267266
/// [`Cell`]: core::cell::Cell
268267
/// [`RefCell`]: core::cell::RefCell
269268
/// [push]: BinaryHeap::push
@@ -1418,7 +1417,6 @@ impl<T> FusedIterator for Iter<'_, T> {}
14181417
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
14191418
///
14201419
/// [`into_iter`]: BinaryHeap::into_iter
1421-
/// [`IntoIterator`]: core::iter::IntoIterator
14221420
#[stable(feature = "rust1", since = "1.0.0")]
14231421
#[derive(Clone)]
14241422
pub struct IntoIter<T> {

library/alloc/src/collections/btree/map.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use core::borrow::Borrow;
33
use core::cmp::Ordering;
44
use core::fmt::{self, Debug};
55
use core::hash::{Hash, Hasher};
6-
use core::iter::{FromIterator, FusedIterator};
6+
use core::iter::FusedIterator;
77
use core::marker::PhantomData;
88
use core::mem::{self, ManuallyDrop};
99
use core::ops::{Bound, Index, RangeBounds};
@@ -420,7 +420,6 @@ impl<'a, K: 'a, V: 'a> Default for IterMut<'a, K, V> {
420420
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
421421
///
422422
/// [`into_iter`]: IntoIterator::into_iter
423-
/// [`IntoIterator`]: core::iter::IntoIterator
424423
#[stable(feature = "rust1", since = "1.0.0")]
425424
#[rustc_insignificant_dtor]
426425
pub struct IntoIter<
@@ -650,7 +649,7 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
650649
#[stable(feature = "rust1", since = "1.0.0")]
651650
pub fn clear(&mut self) {
652651
// avoid moving the allocator
653-
mem::drop(BTreeMap {
652+
drop(BTreeMap {
654653
root: mem::replace(&mut self.root, None),
655654
length: mem::replace(&mut self.length, 0),
656655
alloc: self.alloc.clone(),

library/alloc/src/collections/btree/map/tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ use crate::testing::ord_chaos::{Cyclic3, Governed, Governor};
99
use crate::testing::rng::DeterministicRng;
1010
use crate::vec::Vec;
1111
use std::cmp::Ordering;
12-
use std::convert::TryFrom;
13-
use std::iter::{self, FromIterator};
12+
use std::iter;
1413
use std::mem;
1514
use std::ops::Bound::{self, Excluded, Included, Unbounded};
1615
use std::ops::RangeBounds;

library/alloc/src/collections/btree/set.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::cmp::Ordering::{self, Equal, Greater, Less};
44
use core::cmp::{max, min};
55
use core::fmt::{self, Debug};
66
use core::hash::{Hash, Hasher};
7-
use core::iter::{FromIterator, FusedIterator, Peekable};
7+
use core::iter::{FusedIterator, Peekable};
88
use core::mem::ManuallyDrop;
99
use core::ops::{BitAnd, BitOr, BitXor, RangeBounds, Sub};
1010

@@ -30,7 +30,6 @@ use crate::alloc::{Allocator, Global};
3030
/// Iterators returned by [`BTreeSet::iter`] produce their items in order, and take worst-case
3131
/// logarithmic and amortized constant time per item returned.
3232
///
33-
/// [`Ord`]: core::cmp::Ord
3433
/// [`Cell`]: core::cell::Cell
3534
/// [`RefCell`]: core::cell::RefCell
3635
///
@@ -147,7 +146,6 @@ impl<T: fmt::Debug> fmt::Debug for Iter<'_, T> {
147146
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
148147
///
149148
/// [`into_iter`]: BTreeSet#method.into_iter
150-
/// [`IntoIterator`]: core::iter::IntoIterator
151149
#[stable(feature = "rust1", since = "1.0.0")]
152150
#[derive(Debug)]
153151
pub struct IntoIter<

library/alloc/src/collections/btree/set/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::testing::rng::DeterministicRng;
44
use crate::vec::Vec;
55
use std::cmp::Ordering;
66
use std::hash::{Hash, Hasher};
7-
use std::iter::FromIterator;
87
use std::ops::Bound::{Excluded, Included};
98
use std::panic::{catch_unwind, AssertUnwindSafe};
109

library/alloc/src/collections/linked_list.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use core::cmp::Ordering;
1616
use core::fmt;
1717
use core::hash::{Hash, Hasher};
18-
use core::iter::{FromIterator, FusedIterator};
18+
use core::iter::FusedIterator;
1919
use core::marker::PhantomData;
2020
use core::mem;
2121
use core::ptr::NonNull;
@@ -130,7 +130,6 @@ impl<T: fmt::Debug> fmt::Debug for IterMut<'_, T> {
130130
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
131131
///
132132
/// [`into_iter`]: LinkedList::into_iter
133-
/// [`IntoIterator`]: core::iter::IntoIterator
134133
#[derive(Clone)]
135134
#[stable(feature = "rust1", since = "1.0.0")]
136135
pub struct IntoIter<T> {

library/alloc/src/collections/vec_deque/into_iter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use super::VecDeque;
1212
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
1313
///
1414
/// [`into_iter`]: VecDeque::into_iter
15-
/// [`IntoIterator`]: core::iter::IntoIterator
1615
#[derive(Clone)]
1716
#[stable(feature = "rust1", since = "1.0.0")]
1817
pub struct IntoIter<

0 commit comments

Comments
 (0)