Skip to content

Commit bd9be87

Browse files
committed
Auto merge of rust-lang#118692 - surechen:remove_unused_imports, r=petrochenkov
remove redundant imports detects redundant imports that can be eliminated. for rust-lang#117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR. r? `@petrochenkov`
2 parents 19116af + 987fd98 commit bd9be87

File tree

64 files changed

+29
-131
lines changed

Some content is hidden

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

64 files changed

+29
-131
lines changed

alloc/benches/btree/map.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::collections::BTreeMap;
22
use std::ops::RangeBounds;
3-
use std::vec::Vec;
43

54
use rand::{seq::SliceRandom, Rng};
65
use test::{black_box, Bencher};

alloc/benches/str.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use core::iter::Iterator;
21
use test::{black_box, Bencher};
32

43
#[bench]

alloc/benches/vec_deque.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use core::iter::Iterator;
21
use std::{
32
collections::{vec_deque, VecDeque},
43
mem,

alloc/src/collections/binary_heap/tests.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
use super::*;
22
use crate::boxed::Box;
33
use crate::testing::crash_test::{CrashTestDummy, Panic};
4-
use core::mem;
5-
use std::iter::TrustedLen;
64
use std::panic::{catch_unwind, AssertUnwindSafe};
75

86
#[test]

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use super::Entry::{Occupied, Vacant};
21
use super::*;
32
use crate::boxed::Box;
43
use crate::fmt::Debug;
@@ -7,13 +6,9 @@ use crate::string::{String, ToString};
76
use crate::testing::crash_test::{CrashTestDummy, Panic};
87
use crate::testing::ord_chaos::{Cyclic3, Governed, Governor};
98
use crate::testing::rng::DeterministicRng;
10-
use crate::vec::Vec;
119
use core::assert_matches::assert_matches;
12-
use std::cmp::Ordering;
1310
use std::iter;
14-
use std::mem;
15-
use std::ops::Bound::{self, Excluded, Included, Unbounded};
16-
use std::ops::RangeBounds;
11+
use std::ops::Bound::{Excluded, Included, Unbounded};
1712
use std::panic::{catch_unwind, AssertUnwindSafe};
1813
use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
1914

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
use super::*;
22
use crate::testing::crash_test::{CrashTestDummy, Panic};
33
use crate::testing::rng::DeterministicRng;
4-
use crate::vec::Vec;
5-
use std::cmp::Ordering;
6-
use std::hash::{Hash, Hasher};
74
use std::ops::Bound::{Excluded, Included};
85
use std::panic::{catch_unwind, AssertUnwindSafe};
96

alloc/src/ffi/c_str/tests.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
use super::*;
2-
use crate::rc::Rc;
3-
use crate::sync::Arc;
42
use core::assert_matches::assert_matches;
53
use core::ffi::FromBytesUntilNulError;
64
use core::hash::{Hash, Hasher};

alloc/src/rc/tests.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
use super::*;
22

3-
use std::boxed::Box;
43
use std::cell::RefCell;
54
use std::clone::Clone;
6-
use std::convert::{From, TryInto};
7-
use std::mem::drop;
8-
use std::option::Option::{self, None, Some};
9-
use std::result::Result::{Err, Ok};
105

116
#[test]
127
fn test_clone() {

alloc/src/sync/tests.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
use super::*;
22

3-
use std::boxed::Box;
43
use std::clone::Clone;
5-
use std::convert::{From, TryInto};
6-
use std::mem::drop;
7-
use std::ops::Drop;
8-
use std::option::Option::{self, None, Some};
9-
use std::sync::atomic::{
10-
self,
11-
Ordering::{Acquire, SeqCst},
12-
};
4+
use std::option::Option::None;
5+
use std::sync::atomic::Ordering::SeqCst;
136
use std::sync::mpsc::channel;
147
use std::sync::Mutex;
158
use std::thread;
169

17-
use crate::vec::Vec;
18-
1910
struct Canary(*mut atomic::AtomicUsize);
2011

2112
impl Drop for Canary {

alloc/src/tests.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! Test for `boxed` mod.
22
33
use core::any::Any;
4-
use core::clone::Clone;
5-
use core::convert::TryInto;
64
use core::ops::Deref;
75

86
use std::boxed::Box;

0 commit comments

Comments
 (0)