Skip to content

Commit

Permalink
remove redundant imports
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
surechen committed Dec 10, 2023
1 parent 8ab225d commit e637663
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/abi/comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use std::borrow::Cow;

use rustc_middle::mir;
use rustc_target::abi::call::PassMode;

use crate::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod returning;

use std::borrow::Cow;

use cranelift_codegen::ir::{AbiParam, SigRef};
use cranelift_codegen::ir::SigRef;
use cranelift_module::ModuleError;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc_middle::ty::layout::FnAbiOf;
Expand Down
1 change: 0 additions & 1 deletion src/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
use rustc_index::IndexVec;
use rustc_middle::mir::StatementKind::*;
use rustc_middle::ty::Ty;

use crate::prelude::*;

Expand Down
3 changes: 1 addition & 2 deletions src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
use std::cmp::Ordering;

use cranelift_module::*;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::fx::FxHashSet;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc_middle::mir::interpret::{read_target_uint, AllocId, GlobalAlloc, Scalar};
use rustc_middle::mir::ConstValue;
use rustc_middle::ty::ScalarInt;

use crate::prelude::*;
Expand Down
1 change: 0 additions & 1 deletion src/inline_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use std::fmt::Write;

use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_middle::mir::InlineAsmOperand;
use rustc_span::sym;
use rustc_target::asm::*;
use target_lexicon::BinaryFormat;
Expand Down
2 changes: 0 additions & 2 deletions src/intrinsics/llvm.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! Emulate LLVM intrinsics
use rustc_middle::ty::GenericArgsRef;

use crate::intrinsics::*;
use crate::prelude::*;

Expand Down
2 changes: 0 additions & 2 deletions src/intrinsics/llvm_aarch64.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! Emulate AArch64 LLVM intrinsics
use rustc_middle::ty::GenericArgsRef;

use crate::intrinsics::*;
use crate::prelude::*;

Expand Down
1 change: 0 additions & 1 deletion src/intrinsics/llvm_x86.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Emulate x86 LLVM intrinsics
use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_middle::ty::GenericArgsRef;
use rustc_target::asm::*;

use crate::inline_asm::{codegen_inline_asm_inner, CInlineAsmOperand};
Expand Down
2 changes: 0 additions & 2 deletions src/intrinsics/simd.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//! Codegen `extern "platform-intrinsic"` intrinsics.
use cranelift_codegen::ir::immediates::Offset32;
use rustc_middle::ty::GenericArgsRef;
use rustc_span::Symbol;
use rustc_target::abi::Endian;

use super::*;
Expand Down

0 comments on commit e637663

Please sign in to comment.