Skip to content

Commit 0109fa6

Browse files
committed
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.
1 parent 0252580 commit 0109fa6

8 files changed

+5
-8
lines changed

clippy_lints/src/escape.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use clippy_utils::diagnostics::span_lint_hir;
2-
use rustc_hir::{self, intravisit, AssocItemKind, Body, FnDecl, HirId, HirIdSet, Impl, ItemKind, Node, Pat, PatKind};
2+
use rustc_hir::{intravisit, AssocItemKind, Body, FnDecl, HirId, HirIdSet, Impl, ItemKind, Node, Pat, PatKind};
33
use rustc_hir_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
44
use rustc_infer::infer::TyCtxtInferExt;
55
use rustc_lint::{LateContext, LateLintPass};

clippy_lints/src/loops/manual_memcpy.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use rustc_lint::LateContext;
1212
use rustc_middle::ty::{self, Ty};
1313
use rustc_span::symbol::sym;
1414
use std::fmt::Display;
15-
use std::iter::Iterator;
1615

1716
/// Checks for `for` loops that sequentially copy items from one slice-like
1817
/// object to another.

clippy_lints/src/loops/needless_range_loop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_lint::LateContext;
1313
use rustc_middle::middle::region;
1414
use rustc_middle::ty::{self, Ty};
1515
use rustc_span::symbol::{sym, Symbol};
16-
use std::iter::{self, Iterator};
16+
use std::iter::{self};
1717
use std::mem;
1818

1919
/// Checks for looping over a range and then indexing a sequence with it.

clippy_lints/src/loops/never_loop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_errors::Applicability;
88
use rustc_hir::{Block, Destination, Expr, ExprKind, HirId, InlineAsmOperand, Pat, Stmt, StmtKind};
99
use rustc_lint::LateContext;
1010
use rustc_span::{sym, Span};
11-
use std::iter::{once, Iterator};
11+
use std::iter::once;
1212

1313
pub(super) fn check<'tcx>(
1414
cx: &LateContext<'tcx>,

clippy_lints/src/loops/same_item_push.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use rustc_hir::{BindingAnnotation, Block, Expr, ExprKind, HirId, Mutability, Nod
1111
use rustc_lint::LateContext;
1212
use rustc_span::symbol::sym;
1313
use rustc_span::SyntaxContext;
14-
use std::iter::Iterator;
1514

1615
/// Detects for loop pushing the same item into a Vec
1716
pub(super) fn check<'tcx>(

clippy_lints/src/loops/utils.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use rustc_middle::hir::nested_filter;
99
use rustc_middle::ty::{self, Ty};
1010
use rustc_span::source_map::Spanned;
1111
use rustc_span::symbol::{sym, Symbol};
12-
use std::iter::Iterator;
1312

1413
#[derive(Debug, PartialEq, Eq)]
1514
enum IncrementVisitorVarState {

clippy_lints/src/methods/option_map_unwrap_or.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_data_structures::fx::FxHashSet;
66
use rustc_errors::Applicability;
77
use rustc_hir::def::Res;
88
use rustc_hir::intravisit::{walk_path, Visitor};
9-
use rustc_hir::{self, ExprKind, HirId, Node, PatKind, Path, QPath};
9+
use rustc_hir::{ExprKind, HirId, Node, PatKind, Path, QPath};
1010
use rustc_lint::LateContext;
1111
use rustc_middle::hir::nested_filter;
1212
use rustc_span::{sym, Span};

clippy_lints/src/missing_inline.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clippy_utils::diagnostics::span_lint;
22
use rustc_ast::ast;
33
use rustc_hir as hir;
4-
use rustc_lint::{self, LateContext, LateLintPass, LintContext};
4+
use rustc_lint::{LateContext, LateLintPass, LintContext};
55
use rustc_session::declare_lint_pass;
66
use rustc_span::{sym, Span};
77

0 commit comments

Comments
 (0)