From 697ef95c9f22376232e5dd60ab429fe4a31b6332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Tue, 4 Feb 2020 01:05:45 +0100 Subject: [PATCH] remove redundant imports (clippy::single_component_path_imports) --- src/librustc/traits/mod.rs | 1 - src/librustc/traits/structural_impls.rs | 1 - src/librustc/ty/mod.rs | 1 - src/librustc_builtin_macros/log_syntax.rs | 1 - src/librustc_interface/callbacks.rs | 1 - src/librustc_interface/passes.rs | 4 ---- src/librustc_macros/src/lift.rs | 2 -- src/librustc_macros/src/query.rs | 1 - src/librustc_macros/src/symbols.rs | 1 - src/librustc_macros/src/type_foldable.rs | 2 -- src/librustc_passes/dead.rs | 1 - src/librustc_session/config.rs | 4 ---- src/librustc_session/options.rs | 2 -- src/librustc_session/session.rs | 1 - src/librustc_typeck/variance/mod.rs | 1 - src/librustdoc/clean/utils.rs | 1 - src/librustdoc/config.rs | 2 -- src/librustdoc/core.rs | 1 - src/librustdoc/html/render.rs | 2 -- src/librustdoc/markdown.rs | 1 - src/librustdoc/passes/collect_intra_doc_links.rs | 1 - src/librustdoc/test.rs | 1 - src/libtest/cli.rs | 1 - src/libtest/console.rs | 2 -- 24 files changed, 36 deletions(-) diff --git a/src/librustc/traits/mod.rs b/src/librustc/traits/mod.rs index daaba95cf6b13..b1b3d44044ebc 100644 --- a/src/librustc/traits/mod.rs +++ b/src/librustc/traits/mod.rs @@ -31,7 +31,6 @@ use crate::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; use crate::ty::subst::{InternalSubsts, SubstsRef}; use crate::ty::{self, AdtKind, GenericParamDefKind, List, ToPredicate, Ty, TyCtxt, WithConstness}; use crate::util::common::ErrorReported; -use chalk_engine; use rustc_hir as hir; use rustc_hir::def_id::DefId; use rustc_macros::HashStable; diff --git a/src/librustc/traits/structural_impls.rs b/src/librustc/traits/structural_impls.rs index 58204a460d7df..1db83c5bafac9 100644 --- a/src/librustc/traits/structural_impls.rs +++ b/src/librustc/traits/structural_impls.rs @@ -2,7 +2,6 @@ use crate::traits; use crate::traits::project::Normalized; use crate::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; use crate::ty::{self, Lift, Ty, TyCtxt}; -use chalk_engine; use rustc_span::symbol::Symbol; use smallvec::SmallVec; diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index f417b907a3811..ea29a718b23a3 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -46,7 +46,6 @@ use rustc_target::abi::Align; use syntax::ast::{self, Constness, Ident, Name}; use syntax::node_id::{NodeId, NodeMap, NodeSet}; -use smallvec; use std::cell::RefCell; use std::cmp::{self, Ordering}; use std::fmt; diff --git a/src/librustc_builtin_macros/log_syntax.rs b/src/librustc_builtin_macros/log_syntax.rs index 6d9bfbfd05f0a..ac7ba49ba185d 100644 --- a/src/librustc_builtin_macros/log_syntax.rs +++ b/src/librustc_builtin_macros/log_syntax.rs @@ -1,6 +1,5 @@ use rustc_ast_pretty::pprust; use rustc_expand::base; -use rustc_span; use syntax::tokenstream::TokenStream; pub fn expand_log_syntax<'cx>( diff --git a/src/librustc_interface/callbacks.rs b/src/librustc_interface/callbacks.rs index eb9c118bb0100..803e895857202 100644 --- a/src/librustc_interface/callbacks.rs +++ b/src/librustc_interface/callbacks.rs @@ -11,7 +11,6 @@ use rustc::ty::tls; use rustc_errors::{Diagnostic, TRACK_DIAGNOSTICS}; -use rustc_span; use std::fmt; /// This is a callback from libsyntax as it cannot access the implicit state diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs index 0be73e55e9c1d..bf8bcd71efa41 100644 --- a/src/librustc_interface/passes.rs +++ b/src/librustc_interface/passes.rs @@ -17,7 +17,6 @@ use rustc::traits; use rustc::ty::steal::Steal; use rustc::ty::{self, GlobalCtxt, ResolverOutputs, TyCtxt}; use rustc::util::common::ErrorReported; -use rustc_builtin_macros; use rustc_codegen_ssa::back::link::emit_metadata; use rustc_codegen_utils::codegen_backend::CodegenBackend; use rustc_codegen_utils::link::filename_for_metadata; @@ -26,18 +25,15 @@ use rustc_data_structures::{box_region_allow_access, declare_box_region_type, pa use rustc_errors::PResult; use rustc_expand::base::ExtCtxt; use rustc_hir::def_id::{CrateNum, LOCAL_CRATE}; -use rustc_incremental; use rustc_lint::LintStore; use rustc_mir as mir; use rustc_mir_build as mir_build; use rustc_parse::{parse_crate_from_file, parse_crate_from_source_str}; use rustc_passes::{self, hir_stats, layout_test}; use rustc_plugin_impl as plugin; -use rustc_privacy; use rustc_resolve::{Resolver, ResolverArenas}; use rustc_span::symbol::Symbol; use rustc_span::FileName; -use rustc_traits; use rustc_typeck as typeck; use syntax::mut_visit::MutVisitor; use syntax::{self, ast, visit}; diff --git a/src/librustc_macros/src/lift.rs b/src/librustc_macros/src/lift.rs index 1b91fc5018a23..a246b34b2c295 100644 --- a/src/librustc_macros/src/lift.rs +++ b/src/librustc_macros/src/lift.rs @@ -1,7 +1,5 @@ -use proc_macro2; use quote::quote; use syn::{self, parse_quote}; -use synstructure; pub fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream { s.add_bounds(synstructure::AddBounds::Generics); diff --git a/src/librustc_macros/src/query.rs b/src/librustc_macros/src/query.rs index f680b0d64cded..6dc4f7f251595 100644 --- a/src/librustc_macros/src/query.rs +++ b/src/librustc_macros/src/query.rs @@ -2,7 +2,6 @@ use itertools::Itertools; use proc_macro::TokenStream; use proc_macro2::{Delimiter, TokenTree}; use quote::quote; -use syn; use syn::parse::{Parse, ParseStream, Result}; use syn::punctuated::Punctuated; use syn::spanned::Spanned; diff --git a/src/librustc_macros/src/symbols.rs b/src/librustc_macros/src/symbols.rs index c692c7f399541..feddcd5f99429 100644 --- a/src/librustc_macros/src/symbols.rs +++ b/src/librustc_macros/src/symbols.rs @@ -1,7 +1,6 @@ use proc_macro::TokenStream; use quote::quote; use std::collections::HashSet; -use syn; use syn::parse::{Parse, ParseStream, Result}; use syn::{braced, parse_macro_input, Ident, LitStr, Token}; diff --git a/src/librustc_macros/src/type_foldable.rs b/src/librustc_macros/src/type_foldable.rs index 3d58984a9009b..687401e33449b 100644 --- a/src/librustc_macros/src/type_foldable.rs +++ b/src/librustc_macros/src/type_foldable.rs @@ -1,6 +1,4 @@ use quote::quote; -use syn; -use synstructure; pub fn type_foldable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream { if let syn::Data::Union(_) = s.ast().data { diff --git a/src/librustc_passes/dead.rs b/src/librustc_passes/dead.rs index 2ff9d744f2c4d..9367909d10c30 100644 --- a/src/librustc_passes/dead.rs +++ b/src/librustc_passes/dead.rs @@ -15,7 +15,6 @@ use rustc_hir::itemlikevisit::ItemLikeVisitor; use rustc_hir::{Node, PatKind, TyKind}; use rustc_session::lint; -use rustc_span; use rustc_span::symbol::sym; use syntax::{ast, attr}; diff --git a/src/librustc_session/config.rs b/src/librustc_session/config.rs index 813d14d616d42..ad1a6c4906ea3 100644 --- a/src/librustc_session/config.rs +++ b/src/librustc_session/config.rs @@ -22,8 +22,6 @@ use rustc_span::symbol::{sym, Symbol}; use rustc_errors::emitter::HumanReadableErrorType; use rustc_errors::{ColorConfig, FatalError, Handler, HandlerFlags}; -use getopts; - use std::collections::btree_map::{ Iter as BTreeMapIter, Keys as BTreeMapKeysIter, Values as BTreeMapValuesIter, }; @@ -816,7 +814,6 @@ mod opt { #![allow(dead_code)] use super::RustcOptGroup; - use getopts; pub type R = RustcOptGroup; pub type S = &'static str; @@ -1862,7 +1859,6 @@ pub fn parse_crate_types_from_list(list_list: Vec) -> Result bool { diff --git a/src/librustc_session/options.rs b/src/librustc_session/options.rs index be0e668a467b2..d6b71641da52f 100644 --- a/src/librustc_session/options.rs +++ b/src/librustc_session/options.rs @@ -11,8 +11,6 @@ use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel use rustc_feature::UnstableFeatures; use rustc_span::edition::Edition; -use getopts; - use std::collections::BTreeMap; use std::collections::hash_map::DefaultHasher; diff --git a/src/librustc_session/session.rs b/src/librustc_session/session.rs index a40d6451b958c..f8cba58f9d904 100644 --- a/src/librustc_session/session.rs +++ b/src/librustc_session/session.rs @@ -33,7 +33,6 @@ use rustc_data_structures::jobserver::{self, Client}; use rustc_data_structures::profiling::{SelfProfiler, SelfProfilerRef}; use rustc_target::spec::{PanicStrategy, RelroLevel, Target, TargetTriple}; -use std; use std::cell::{self, RefCell}; use std::env; use std::fmt; diff --git a/src/librustc_typeck/variance/mod.rs b/src/librustc_typeck/variance/mod.rs index 27dc03bbbe206..32bd7e4c4c1d0 100644 --- a/src/librustc_typeck/variance/mod.rs +++ b/src/librustc_typeck/variance/mod.rs @@ -3,7 +3,6 @@ //! //! [rustc guide]: https://rust-lang.github.io/rustc-guide/variance.html -use arena; use hir::Node; use rustc::ty::query::Providers; use rustc::ty::{self, CrateVariancesMap, TyCtxt}; diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index e110545c6f27b..356660763a755 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -16,7 +16,6 @@ use rustc_data_structures::fx::FxHashSet; use rustc_hir as hir; use rustc_hir::def::{DefKind, Res}; use rustc_hir::def_id::{DefId, LOCAL_CRATE}; -use rustc_span; use rustc_span::symbol::{kw, sym, Symbol}; use std::mem; diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 22f5d0dc2c078..1b776930d7a78 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -3,7 +3,6 @@ use std::ffi::OsStr; use std::fmt; use std::path::PathBuf; -use getopts; use rustc::lint::Level; use rustc::session; use rustc::session::config::{ @@ -13,7 +12,6 @@ use rustc::session::config::{ use rustc::session::config::{parse_crate_types_from_list, parse_externs, CrateType}; use rustc::session::config::{CodegenOptions, DebuggingOptions, ErrorOutputType, Externs}; use rustc::session::search_paths::SearchPath; -use rustc_driver; use rustc_span::edition::{Edition, DEFAULT_EDITION}; use rustc_target::spec::TargetTriple; diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index a8baa89c6f181..429988db9d843 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -11,7 +11,6 @@ use rustc_hir::def::Namespace::TypeNS; use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LOCAL_CRATE}; use rustc_hir::HirId; use rustc_interface::interface; -use rustc_lint; use rustc_resolve as resolve; use rustc_session::lint; diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index c670641394267..e2a0126a8fabb 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -73,8 +73,6 @@ use crate::html::markdown::{self, ErrorCodes, IdMap, Markdown, MarkdownHtml, Mar use crate::html::sources; use crate::html::{highlight, layout, static_files}; -use minifier; - #[cfg(test)] mod tests; diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs index 912a40722b8af..a37efc22c9305 100644 --- a/src/librustdoc/markdown.rs +++ b/src/librustdoc/markdown.rs @@ -5,7 +5,6 @@ use std::path::PathBuf; use rustc_feature::UnstableFeatures; use rustc_span::edition::Edition; use rustc_span::source_map::DUMMY_SP; -use testing; use crate::config::{Options, RenderOptions}; use crate::externalfiles::{load_string, LoadStringError}; diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 50d5f70f4889a..332d19fbfaeca 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -13,7 +13,6 @@ use rustc_hir::def_id::DefId; use rustc_resolve::ParentScope; use rustc_span::symbol::Symbol; use rustc_span::DUMMY_SP; -use syntax; use syntax::ast::{self, Ident}; use std::ops::Range; diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 936f63975a58e..2892c4b153790 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -20,7 +20,6 @@ use std::str; use syntax::ast; use syntax::with_globals; use tempfile::Builder as TempFileBuilder; -use testing; use crate::clean::Attributes; use crate::config::Options; diff --git a/src/libtest/cli.rs b/src/libtest/cli.rs index edff8bea0f3d0..778600b2196b7 100644 --- a/src/libtest/cli.rs +++ b/src/libtest/cli.rs @@ -1,6 +1,5 @@ //! Module converting command-line arguments into test configuration. -use getopts; use std::env; use std::path::PathBuf; diff --git a/src/libtest/console.rs b/src/libtest/console.rs index ebdfb16294759..149c9202e6e2d 100644 --- a/src/libtest/console.rs +++ b/src/libtest/console.rs @@ -4,8 +4,6 @@ use std::fs::File; use std::io; use std::io::prelude::Write; -use term; - use super::{ bench::fmt_bench_samples, cli::TestOpts,