From 541c4999a9e878f26ada62bc9a82f088a8f2fad2 Mon Sep 17 00:00:00 2001 From: Fabian Drinck Date: Sun, 10 Mar 2019 12:52:30 +0100 Subject: [PATCH] Remove redundant imports --- src/librustc/ty/query/on_disk_cache.rs | 1 - src/librustc_codegen_llvm/context.rs | 1 - src/librustc_codegen_ssa/mir/rvalue.rs | 1 - src/librustc_errors/lib.rs | 2 +- src/librustc_interface/profile/mod.rs | 1 - src/librustc_mir/hair/pattern/mod.rs | 1 - src/librustc_mir/interpret/operator.rs | 2 -- src/librustc_resolve/lib.rs | 1 - src/librustc_traits/lowering/environment.rs | 2 +- src/librustc_typeck/check/wfcheck.rs | 5 ----- 10 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs index 1b4c36b8b06..05d80f9203f 100644 --- a/src/librustc/ty/query/on_disk_cache.rs +++ b/src/librustc/ty/query/on_disk_cache.rs @@ -777,7 +777,6 @@ impl<'enc, 'a, 'tcx, E> CacheEncoder<'enc, 'a, 'tcx, E> value: &V) -> Result<(), E::Error> { - use crate::ty::codec::TyEncoder; let start_pos = self.position(); tag.encode(self)?; diff --git a/src/librustc_codegen_llvm/context.rs b/src/librustc_codegen_llvm/context.rs index fc79e868fb4..f6956bd5736 100644 --- a/src/librustc_codegen_llvm/context.rs +++ b/src/librustc_codegen_llvm/context.rs @@ -372,7 +372,6 @@ impl MiscMethods<'tcx> for CodegenCx<'ll, 'tcx> { // Returns a Value of the "eh_unwind_resume" lang item if one is defined, // otherwise declares it as an external function. fn eh_unwind_resume(&self) -> &'ll Value { - use crate::attributes; let unwresume = &self.eh_unwind_resume; if let Some(llfn) = unwresume.get() { return llfn; diff --git a/src/librustc_codegen_ssa/mir/rvalue.rs b/src/librustc_codegen_ssa/mir/rvalue.rs index 7a31c5b3950..fc4f6b83247 100644 --- a/src/librustc_codegen_ssa/mir/rvalue.rs +++ b/src/librustc_codegen_ssa/mir/rvalue.rs @@ -732,7 +732,6 @@ fn cast_int_to_float<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( // All inputs greater or equal to (f32::MAX + 0.5 ULP) are rounded to infinity, // and for everything else LLVM's uitofp works just fine. use rustc_apfloat::ieee::Single; - use rustc_apfloat::Float; const MAX_F32_PLUS_HALF_ULP: u128 = ((1 << (Single::PRECISION + 1)) - 1) << (Single::MAX_EXP - Single::PRECISION as i16); let max = bx.cx().const_uint_big(int_ty, MAX_F32_PLUS_HALF_ULP); diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 6b4b437930d..ebbc5a3d3a3 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -155,7 +155,7 @@ impl CodeSuggestion { /// Returns the assembled code suggestions and whether they should be shown with an underline. pub fn splice_lines(&self, cm: &SourceMapperDyn) -> Vec<(String, Vec)> { - use syntax_pos::{CharPos, Loc, Pos}; + use syntax_pos::{CharPos, Pos}; fn push_trailing(buf: &mut String, line_opt: Option<&Cow<'_, str>>, diff --git a/src/librustc_interface/profile/mod.rs b/src/librustc_interface/profile/mod.rs index d0c8dff2070..2e71d46f415 100644 --- a/src/librustc_interface/profile/mod.rs +++ b/src/librustc_interface/profile/mod.rs @@ -62,7 +62,6 @@ fn total_duration(traces: &[trace::Rec]) -> Duration { fn profile_queries_thread(r: Receiver) { use self::trace::*; use std::fs::File; - use std::time::{Instant}; let mut profq_msgs: Vec = vec![]; let mut frame: StackFrame = StackFrame { parse_st: ParseState::Clear, traces: vec![] }; diff --git a/src/librustc_mir/hair/pattern/mod.rs b/src/librustc_mir/hair/pattern/mod.rs index 6c532fce57f..622cf00ed86 100644 --- a/src/librustc_mir/hair/pattern/mod.rs +++ b/src/librustc_mir/hair/pattern/mod.rs @@ -427,7 +427,6 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> { let mut kind = match (lo, hi) { (PatternKind::Constant { value: lo }, PatternKind::Constant { value: hi }) => { - use std::cmp::Ordering; let cmp = compare_const_vals( self.tcx, lo, diff --git a/src/librustc_mir/interpret/operator.rs b/src/librustc_mir/interpret/operator.rs index ca93007788e..488f81d8f74 100644 --- a/src/librustc_mir/interpret/operator.rs +++ b/src/librustc_mir/interpret/operator.rs @@ -331,8 +331,6 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M> val: ImmTy<'tcx, M::PointerTag>, ) -> EvalResult<'tcx, Scalar> { use rustc::mir::UnOp::*; - use rustc_apfloat::ieee::{Single, Double}; - use rustc_apfloat::Float; let layout = val.layout; let val = val.to_scalar()?; diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index ab3d87fafda..3703ea08b62 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -1738,7 +1738,6 @@ impl<'a> Resolver<'a> { /// just that an error occurred. pub fn resolve_str_path_error(&mut self, span: Span, path_str: &str, is_value: bool) -> Result { - use std::iter; let mut errored = false; let path = if path_str.starts_with("::") { diff --git a/src/librustc_traits/lowering/environment.rs b/src/librustc_traits/lowering/environment.rs index 3570cb10246..eb47892ea41 100644 --- a/src/librustc_traits/lowering/environment.rs +++ b/src/librustc_traits/lowering/environment.rs @@ -164,7 +164,7 @@ crate fn environment<'a, 'tcx>( tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId ) -> Environment<'tcx> { - use super::{Lower, IntoFromEnvGoal}; + use super::IntoFromEnvGoal; use rustc::hir::{Node, TraitItemKind, ImplItemKind, ItemKind, ForeignItemKind}; debug!("environment(def_id = {:?})", def_id); diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 920270b5473..3579810b8d7 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -420,9 +420,6 @@ fn check_where_clauses<'a, 'gcx, 'fcx, 'tcx>( def_id: DefId, return_ty: Option>, ) { - use ty::subst::Subst; - use rustc::ty::TypeFoldable; - let predicates = fcx.tcx.predicates_of(def_id); let generics = tcx.generics_of(def_id); @@ -1010,8 +1007,6 @@ fn check_false_global_bounds<'a, 'gcx, 'tcx>( span: Span, id: hir::HirId) { - use rustc::ty::TypeFoldable; - let empty_env = ty::ParamEnv::empty(); let def_id = fcx.tcx.hir().local_def_id_from_hir_id(id);