Skip to content

Commit a6ac5fa

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

File tree

14 files changed

+5
-18
lines changed

14 files changed

+5
-18
lines changed

src/borrow_tracker/stacked_borrows/diagnostics.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ use smallvec::SmallVec;
22
use std::fmt;
33

44
use rustc_data_structures::fx::FxHashSet;
5-
use rustc_middle::mir::interpret::{alloc_range, AllocId, AllocRange, InterpError};
65
use rustc_span::{Span, SpanData};
76
use rustc_target::abi::Size;
87

98
use crate::borrow_tracker::{
10-
stacked_borrows::Permission, AccessKind, GlobalStateInner, ProtectorKind,
9+
AccessKind, GlobalStateInner, ProtectorKind,
1110
};
1211
use crate::*;
1312

src/borrow_tracker/stacked_borrows/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ use rustc_target::abi::{Abi, Size};
1818

1919
use crate::borrow_tracker::{
2020
stacked_borrows::diagnostics::{AllocHistory, DiagnosticCx, DiagnosticCxBuilder},
21-
AccessKind, GlobalStateInner, ProtectorKind, RetagFields,
22-
};
21+
AccessKind, GlobalStateInner, ProtectorKind,};
2322
use crate::*;
2423

2524
use diagnostics::{RetagCause, RetagInfo};

src/borrow_tracker/tree_borrows/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use log::trace;
33
use rustc_target::abi::{Abi, Size};
44

55
use crate::borrow_tracker::{
6-
AccessKind, GlobalState, GlobalStateInner, ProtectorKind, RetagFields,
6+
AccessKind, GlobalState, GlobalStateInner, ProtectorKind,
77
};
88
use rustc_middle::{
99
mir::{Mutability, RetagKind},

src/borrow_tracker/tree_borrows/tree.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use std::fmt;
1414

1515
use smallvec::SmallVec;
1616

17-
use rustc_const_eval::interpret::InterpResult;
1817
use rustc_data_structures::fx::FxHashSet;
1918
use rustc_span::Span;
2019
use rustc_target::abi::Size;

src/concurrency/weak_memory.rs

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ use std::{
8282
collections::VecDeque,
8383
};
8484

85-
use rustc_const_eval::interpret::{alloc_range, AllocRange, InterpResult, MPlaceTy, Scalar};
8685
use rustc_data_structures::fx::FxHashMap;
8786

8887
use crate::*;

src/eval.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use std::thread;
1010
use log::info;
1111
use rustc_middle::ty::Ty;
1212

13-
use crate::borrow_tracker::RetagFields;
1413
use crate::concurrency::thread::TlsAllocAction;
1514
use crate::diagnostics::report_leaks;
1615
use rustc_data_structures::fx::FxHashSet;

src/shims/env.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::ffi::{OsStr, OsString};
33
use std::io::ErrorKind;
44
use std::mem;
55

6-
use rustc_const_eval::interpret::Pointer;
76
use rustc_data_structures::fx::FxHashMap;
87
use rustc_middle::ty::layout::LayoutOf;
98
use rustc_middle::ty::Ty;

src/shims/unix/fs.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::any::Any;
22
use std::borrow::Cow;
33
use std::collections::BTreeMap;
4-
use std::convert::TryInto;
54
use std::fs::{
65
read_dir, remove_dir, remove_file, rename, DirBuilder, File, FileType, OpenOptions, ReadDir,
76
};

src/shims/unix/linux/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::time::SystemTime;
22

3-
use crate::concurrency::thread::{MachineCallback, Time};
3+
use crate::concurrency::thread::MachineCallback;
44
use crate::*;
55

66
/// Implementation of the SYS_futex syscall.

src/shims/unix/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::time::SystemTime;
22

33
use crate::concurrency::sync::CondvarLock;
4-
use crate::concurrency::thread::{MachineCallback, Time};
4+
use crate::concurrency::thread::MachineCallback;
55
use crate::*;
66

77
// pthread_mutexattr_t is either 4 or 8 bytes, depending on the platform.

tests/pass-dep/shims/libc-fs.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![feature(io_error_more)]
55
#![feature(io_error_uncategorized)]
66

7-
use std::convert::TryInto;
87
use std::ffi::CString;
98
use std::fs::{canonicalize, remove_dir_all, remove_file, File};
109
use std::io::{Error, ErrorKind, Write};

tests/pass/arrays.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::convert::TryFrom;
2-
31
fn empty_array() -> [u16; 0] {
42
[]
53
}

tests/pass/binary-heap.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::collections::BinaryHeap;
2-
use std::iter::Iterator;
32

43
fn zero_sized_push() {
54
const N: usize = 8;

tests/pass/enum-nullable-const-null-with-fields.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::result::Result;
2-
use std::result::Result::Ok;
31

42
static C: Result<(), Box<isize>> = Ok(());
53

0 commit comments

Comments
 (0)