Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 4b64fbf

Browse files
committed
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.
1 parent 2896841 commit 4b64fbf

File tree

284 files changed

+140
-511
lines changed

Some content is hidden

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

284 files changed

+140
-511
lines changed

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
//! a `MutVisitor` renaming item names in a module will miss all of those
88
//! that are created by the expansion of a macro.
99
10+
use crate::ast::*;
1011
use crate::ptr::P;
1112
use crate::token::{self, Token};
1213
use crate::tokenstream::*;
13-
use crate::{ast::*, StaticItem};
1414

1515
use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
1616
use rustc_data_structures::stack::ensure_sufficient_stack;

compiler/rustc_ast/src/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_macros::HashStable_Generic;
1313
use rustc_span::symbol::{kw, sym};
1414
#[allow(hidden_glob_reexports)]
1515
use rustc_span::symbol::{Ident, Symbol};
16-
use rustc_span::{self, edition::Edition, Span, DUMMY_SP};
16+
use rustc_span::{edition::Edition, Span, DUMMY_SP};
1717
use std::borrow::Cow;
1818
use std::fmt;
1919

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! instance, a walker looking for item names in a module will miss all of
1414
//! those that are created by the expansion of a macro.
1515
16-
use crate::{ast::*, StaticItem};
16+
use crate::ast::*;
1717

1818
use rustc_span::symbol::Ident;
1919
use rustc_span::Span;

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use super::errors::{
77
use super::ResolverAstLoweringExt;
88
use super::{ImplTraitContext, LoweringContext, ParamMode, ParenthesizedGenericArgs};
99
use crate::{FnDeclKind, ImplTraitPosition};
10-
use rustc_ast::attr;
1110
use rustc_ast::ptr::P as AstP;
1211
use rustc_ast::*;
1312
use rustc_data_structures::stack::ensure_sufficient_stack;

compiler/rustc_ast_lowering/src/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::LoweringContext;
22
use rustc_ast as ast;
3-
use rustc_ast::visit::{self, Visitor};
3+
use rustc_ast::visit::Visitor;
44
use rustc_ast::*;
55
use rustc_data_structures::fx::FxIndexMap;
66
use rustc_hir as hir;

compiler/rustc_ast_lowering/src/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc_data_structures::fx::FxHashMap;
22
use rustc_data_structures::sorted_map::SortedMap;
33
use rustc_hir as hir;
44
use rustc_hir::def_id::LocalDefId;
5-
use rustc_hir::intravisit::{self, Visitor};
5+
use rustc_hir::intravisit::Visitor;
66
use rustc_hir::*;
77
use rustc_index::{Idx, IndexVec};
88
use rustc_middle::span_bug;

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ extern crate tracing;
4545
use crate::errors::{AssocTyParentheses, AssocTyParenthesesSub, MisplacedImplTrait};
4646

4747
use rustc_ast::ptr::P;
48-
use rustc_ast::visit;
4948
use rustc_ast::{self as ast, *};
5049
use rustc_ast_pretty::pprust;
5150
use rustc_data_structures::captures::Captures;

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
use itertools::{Either, Itertools};
1010
use rustc_ast::ptr::P;
11-
use rustc_ast::visit::{self, AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor};
11+
use rustc_ast::visit::{AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor};
12+
use rustc_ast::walk_list;
1213
use rustc_ast::*;
13-
use rustc_ast::{walk_list, StaticItem};
1414
use rustc_ast_pretty::pprust::{self, State};
1515
use rustc_data_structures::fx::FxIndexMap;
1616
use rustc_feature::Features;

compiler/rustc_borrowck/src/dataflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_middle::ty::RegionVid;
1010
use rustc_middle::ty::TyCtxt;
1111
use rustc_mir_dataflow::impls::{EverInitializedPlaces, MaybeUninitializedPlaces};
1212
use rustc_mir_dataflow::ResultsVisitable;
13-
use rustc_mir_dataflow::{self, fmt::DebugWithContext, GenKill};
13+
use rustc_mir_dataflow::{fmt::DebugWithContext, GenKill};
1414
use rustc_mir_dataflow::{Analysis, Direction, Results};
1515
use std::fmt;
1616

compiler/rustc_borrowck/src/region_infer/graphviz.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use std::borrow::Cow;
88
use std::io::{self, Write};
99

1010
use super::*;
11-
use crate::constraints::OutlivesConstraint;
1211
use rustc_graphviz as dot;
1312

1413
impl<'tcx> RegionInferenceContext<'tcx> {

0 commit comments

Comments
 (0)