Skip to content

Commit

Permalink
Remove unused trait imports flagged by lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sanxiyn committed May 3, 2016
1 parent 7d8100a commit 7ad1900
Show file tree
Hide file tree
Showing 39 changed files with 13 additions and 50 deletions.
1 change: 0 additions & 1 deletion src/libcoretest/lib.rs
Expand Up @@ -15,7 +15,6 @@
#![feature(box_syntax)]
#![feature(cell_extras)]
#![feature(const_fn)]
#![feature(core_float)]
#![feature(core_private_bignum)]
#![feature(core_private_diy_float)]
#![feature(dec2flt)]
Expand Down
1 change: 0 additions & 1 deletion src/libcoretest/num/mod.rs
Expand Up @@ -52,7 +52,6 @@ pub fn test_num<T>(ten: T, two: T) where
mod tests {
use core::option::Option;
use core::option::Option::{Some, None};
use core::num::Float;

#[test]
fn from_str_issue7588() {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_const_eval/eval.rs
Expand Up @@ -17,7 +17,7 @@ use self::EvalHint::*;

use rustc::hir::map as ast_map;
use rustc::hir::map::blocks::FnLikeNode;
use rustc::middle::cstore::{self, CrateStore, InlinedItem};
use rustc::middle::cstore::{self, InlinedItem};
use rustc::{infer, traits};
use rustc::hir::def::Def;
use rustc::hir::def_id::DefId;
Expand Down
1 change: 0 additions & 1 deletion src/librustc_driver/lib.rs
Expand Up @@ -70,7 +70,6 @@ use rustc_trans::back::link;
use rustc::session::{self, config, Session, build_session, CompileResult};
use rustc::session::config::{Input, PrintRequest, OutputType, ErrorOutputType};
use rustc::session::config::{get_unstable_features_setting, nightly_options};
use rustc::middle::cstore::CrateStore;
use rustc::lint::Lint;
use rustc::lint;
use rustc_metadata::loader;
Expand Down
1 change: 0 additions & 1 deletion src/librustc_incremental/persist/data.rs
Expand Up @@ -11,7 +11,6 @@
//! The data that we will serialize and deserialize.

use rustc::dep_graph::DepNode;
use rustc_serialize::{Decoder as RustcDecoder, Encoder as RustcEncoder};

use super::directory::DefPathIndex;

Expand Down
1 change: 0 additions & 1 deletion src/librustc_incremental/persist/directory.rs
Expand Up @@ -18,7 +18,6 @@ use rustc::hir::map::DefPath;
use rustc::hir::def_id::DefId;
use rustc::ty;
use rustc::util::nodemap::DefIdMap;
use rustc_serialize::{Decoder as RustcDecoder, Encoder as RustcEncoder};
use std::fmt::{self, Debug};

/// Index into the DefIdDirectory
Expand Down
1 change: 0 additions & 1 deletion src/librustc_lint/builtin.rs
Expand Up @@ -29,7 +29,6 @@
//! a `pub fn new()`.

use rustc::hir::def::Def;
use middle::cstore::CrateStore;
use rustc::hir::def_id::DefId;
use middle::stability;
use rustc::{cfg, infer};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_lint/types.rs
Expand Up @@ -26,7 +26,7 @@ use std::{i8, i16, i32, i64, u8, u16, u32, u64, f32, f64};

use syntax::ast;
use syntax::abi::Abi;
use syntax::attr::{self, AttrMetaMethods};
use syntax::attr;
use syntax::codemap::{self, Span};

use rustc::hir;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/csearch.rs
Expand Up @@ -536,7 +536,7 @@ impl<'tcx> CrateStore<'tcx> for cstore::CStore {
let mut visible_parent_map = self.visible_parent_map.borrow_mut();
if !visible_parent_map.is_empty() { return visible_parent_map; }

use rustc::middle::cstore::{CrateStore, ChildItem};
use rustc::middle::cstore::ChildItem;
use std::collections::vec_deque::VecDeque;
use std::collections::hash_map::Entry;
for cnum in 1 .. self.next_crate_num() {
Expand Down
1 change: 0 additions & 1 deletion src/librustc_metadata/decoder.rs
Expand Up @@ -43,7 +43,6 @@ use rustc::mir;
use rustc::mir::visit::MutVisitor;

use std::cell::Cell;
use std::io::prelude::*;
use std::io;
use std::rc::Rc;
use std::str;
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_metadata/encoder.rs
Expand Up @@ -21,7 +21,7 @@ use def_key;
use tyencode;
use index::{self, IndexData};

use middle::cstore::{LOCAL_CRATE, CrateStore, InlinedItemRef, LinkMeta, tls};
use middle::cstore::{LOCAL_CRATE, InlinedItemRef, LinkMeta, tls};
use rustc::hir::def;
use rustc::hir::def_id::{CRATE_DEF_INDEX, DefId};
use middle::dependency_format::Linkage;
Expand All @@ -46,7 +46,6 @@ use syntax::abi::Abi;
use syntax::ast::{self, NodeId, Name, CRATE_NODE_ID, CrateNum};
use syntax::codemap::BytePos;
use syntax::attr;
use syntax::attr::AttrMetaMethods;
use syntax::errors::Handler;
use syntax;
use rbml::writer::Encoder;
Expand Down
1 change: 0 additions & 1 deletion src/librustc_metadata/loader.rs
Expand Up @@ -233,7 +233,6 @@ use std::cmp;
use std::collections::HashMap;
use std::fmt;
use std::fs;
use std::io::prelude::*;
use std::io;
use std::path::{Path, PathBuf};
use std::ptr;
Expand Down
1 change: 0 additions & 1 deletion src/librustc_privacy/lib.rs
Expand Up @@ -34,7 +34,6 @@ use rustc::hir::intravisit::{self, Visitor};

use rustc::dep_graph::DepNode;
use rustc::lint;
use rustc::middle::cstore::CrateStore;
use rustc::hir::def::{self, Def};
use rustc::hir::def_id::DefId;
use rustc::middle::privacy::{AccessLevel, AccessLevels};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/build_reduced_graph.rs
Expand Up @@ -21,7 +21,7 @@ use ParentLink::{ModuleParentLink, BlockParentLink};
use Resolver;
use {resolve_error, resolve_struct_error, ResolutionError};

use rustc::middle::cstore::{CrateStore, ChildItem, DlDef};
use rustc::middle::cstore::{ChildItem, DlDef};
use rustc::lint;
use rustc::hir::def::*;
use rustc::hir::def_id::{CRATE_DEF_INDEX, DefId};
Expand Down
2 changes: 0 additions & 2 deletions src/librustc_resolve/lib.rs
Expand Up @@ -47,7 +47,6 @@ use rustc::dep_graph::DepNode;
use rustc::hir::map as hir_map;
use rustc::session::Session;
use rustc::lint;
use rustc::middle::cstore::CrateStore;
use rustc::hir::def::*;
use rustc::hir::def_id::DefId;
use rustc::hir::pat_util::pat_bindings;
Expand All @@ -58,7 +57,6 @@ use rustc::util::nodemap::{NodeMap, FnvHashMap, FnvHashSet};

use syntax::ast::{self, FloatTy};
use syntax::ast::{CRATE_NODE_ID, Name, NodeId, CrateNum, IntTy, UintTy};
use syntax::attr::AttrMetaMethods;
use syntax::codemap::{self, Span, Pos};
use syntax::errors::DiagnosticBuilder;
use syntax::parse::token::{self, keywords};
Expand Down
1 change: 0 additions & 1 deletion src/librustc_resolve/resolve_imports.rs
Expand Up @@ -25,7 +25,6 @@ use rustc::lint;
use rustc::hir::def::*;

use syntax::ast::{NodeId, Name};
use syntax::attr::AttrMetaMethods;
use syntax::codemap::{Span, DUMMY_SP};
use syntax::util::lev_distance::find_best_match_for_name;

Expand Down
2 changes: 0 additions & 2 deletions src/librustc_save_analysis/data.rs
Expand Up @@ -13,8 +13,6 @@
//! The `Dump` trait can be used together with `DumpVisitor` in order to
//! retrieve the data from a crate.

use std::hash::Hasher;

use rustc::hir::def_id::DefId;
use rustc::ty;
use syntax::ast::{CrateNum, NodeId};
Expand Down
2 changes: 0 additions & 2 deletions src/librustc_trans/back/archive.rs
Expand Up @@ -21,8 +21,6 @@ use std::process::{Command, Output, Stdio};
use std::ptr;
use std::str;

use middle::cstore::CrateStore;

use libc;
use llvm::archive_ro::{ArchiveRO, Child};
use llvm::{self, ArchiveKind};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/back/link.rs
Expand Up @@ -19,7 +19,7 @@ use session::config::{OutputFilenames, Input, OutputType};
use session::filesearch;
use session::search_paths::PathKind;
use session::Session;
use middle::cstore::{self, CrateStore, LinkMeta};
use middle::cstore::{self, LinkMeta};
use middle::cstore::{LinkagePreference, NativeLibraryKind};
use middle::dependency_format::Linkage;
use CrateTranslation;
Expand Down
1 change: 0 additions & 1 deletion src/librustc_trans/back/linker.rs
Expand Up @@ -16,7 +16,6 @@ use std::path::{Path, PathBuf};
use std::process::Command;

use back::archive;
use middle::cstore::CrateStore;
use middle::dependency_format::Linkage;
use session::Session;
use session::config::CrateTypeDylib;
Expand Down
1 change: 0 additions & 1 deletion src/librustc_trans/base.rs
Expand Up @@ -35,7 +35,6 @@ use lint;
use llvm::{BasicBlockRef, Linkage, ValueRef, Vector, get_param};
use llvm;
use rustc::cfg;
use middle::cstore::CrateStore;
use rustc::hir::def_id::DefId;
use rustc::infer;
use middle::lang_items::{LangItem, ExchangeMallocFnLangItem, StartFnLangItem};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/common.rs
Expand Up @@ -39,7 +39,7 @@ use type_::Type;
use value::Value;
use rustc::ty::{self, Ty, TyCtxt};
use rustc::traits::{self, SelectionContext, ProjectionMode};
use rustc::ty::fold::{TypeFolder, TypeFoldable};
use rustc::ty::fold::TypeFoldable;
use rustc::hir;
use util::nodemap::NodeMap;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/inline.rs
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

use llvm::{AvailableExternallyLinkage, InternalLinkage, SetLinkage};
use middle::cstore::{CrateStore, FoundAst, InlinedItem};
use middle::cstore::{FoundAst, InlinedItem};
use rustc::hir::def_id::DefId;
use rustc::ty::subst::Substs;
use base::{push_ctxt, trans_item, trans_fn};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/coercion.rs
Expand Up @@ -71,7 +71,7 @@ use rustc::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer};
use rustc::ty::{self, LvaluePreference, TypeAndMut, Ty, TyCtxt};
use rustc::ty::fold::TypeFoldable;
use rustc::ty::error::TypeError;
use rustc::ty::relate::{RelateResult, TypeRelation};
use rustc::ty::relate::RelateResult;
use util::common::indent;

use std::cell::RefCell;
Expand Down
3 changes: 0 additions & 3 deletions src/librustc_typeck/check/intrinsic.rs
Expand Up @@ -11,18 +11,15 @@
//! Type-checking for the rust-intrinsic and platform-intrinsic
//! intrinsics that the compiler exposes.

use astconv::AstConv;
use intrinsics;
use rustc::ty::subst::{self, Substs};
use rustc::ty::FnSig;
use rustc::ty::{self, Ty, TyCtxt};
use rustc::ty::fold::TypeFolder;
use {CrateCtxt, require_same_types};

use std::collections::{HashMap};
use syntax::abi::Abi;
use syntax::ast;
use syntax::attr::AttrMetaMethods;
use syntax::codemap::Span;
use syntax::parse::token;

Expand Down
1 change: 0 additions & 1 deletion src/librustc_typeck/check/method/mod.rs
Expand Up @@ -10,7 +10,6 @@

//! Method lookup: the secret sauce of Rust. See `README.md`.

use astconv::AstConv;
use check::FnCtxt;
use hir::def::Def;
use hir::def_id::DefId;
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_typeck/check/method/suggest.rs
Expand Up @@ -13,11 +13,10 @@

use CrateCtxt;

use astconv::AstConv;
use check::{self, FnCtxt, UnresolvedTypeAction, autoderef};
use rustc::hir::map as hir_map;
use rustc::ty::{self, Ty, ToPolyTraitRef, ToPredicate, TypeFoldable};
use middle::cstore::{self, CrateStore};
use middle::cstore;
use hir::def::Def;
use hir::def_id::DefId;
use middle::lang_items::FnOnceTraitLangItem;
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_typeck/check/mod.rs
Expand Up @@ -99,8 +99,7 @@ use rustc::ty::{self, ToPolyTraitRef, Ty, TyCtxt, Visibility};
use rustc::ty::{MethodCall, MethodCallee};
use rustc::ty::adjustment;
use rustc::ty::error::TypeError;
use rustc::ty::fold::{TypeFolder, TypeFoldable};
use rustc::ty::relate::TypeRelation;
use rustc::ty::fold::TypeFoldable;
use rustc::ty::util::{Representability, IntTypeExt};
use require_c_abi_if_variadic;
use rscope::{ElisionFailureInfo, RegionScope};
Expand Down
1 change: 0 additions & 1 deletion src/librustc_typeck/check/regionck.rs
Expand Up @@ -82,7 +82,6 @@
//! relation, except that a borrowed pointer never owns its
//! contents.

use astconv::AstConv;
use check::dropck;
use check::FnCtxt;
use middle::free_region::FreeRegionMap;
Expand Down
2 changes: 0 additions & 2 deletions src/librustc_typeck/check/wfcheck.rs
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use astconv::AstConv;
use check::{FnCtxt, Inherited, blank_fn_ctxt, regionck};
use constrained_type_params::{identify_constrained_type_params, Parameter};
use CrateCtxt;
Expand All @@ -17,7 +16,6 @@ use middle::region::{CodeExtent};
use rustc::ty::subst::{self, TypeSpace, FnSpace, ParamSpace, SelfSpace};
use rustc::traits;
use rustc::ty::{self, Ty, TyCtxt};
use rustc::ty::fold::{TypeFolder};

use std::cell::RefCell;
use std::collections::HashSet;
Expand Down
1 change: 0 additions & 1 deletion src/librustc_typeck/check/writeback.rs
Expand Up @@ -13,7 +13,6 @@
// substitutions.
use self::ResolveReason::*;

use astconv::AstConv;
use check::FnCtxt;
use hir::def_id::DefId;
use hir::pat_util;
Expand Down
1 change: 0 additions & 1 deletion src/librustc_typeck/coherence/overlap.rs
Expand Up @@ -12,7 +12,6 @@
//! same type. Likewise, no two inherent impls for a given type
//! constructor provide a method with the same name.

use middle::cstore::CrateStore;
use hir::def_id::DefId;
use rustc::traits::{self, ProjectionMode};
use rustc::infer;
Expand Down
1 change: 0 additions & 1 deletion src/librustc_typeck/collect.rs
Expand Up @@ -73,7 +73,6 @@ use rustc::ty::subst::{Substs, FnSpace, ParamSpace, SelfSpace, TypeSpace, VecPer
use rustc::ty::{ToPredicate, ImplContainer, ImplOrTraitItemContainer, TraitContainer};
use rustc::ty::{self, ToPolyTraitRef, Ty, TyCtxt, TypeScheme};
use rustc::ty::{VariantKind};
use rustc::ty::fold::{TypeFolder};
use rustc::ty::util::IntTypeExt;
use rscope::*;
use rustc::dep_graph::DepNode;
Expand Down
3 changes: 1 addition & 2 deletions src/librustdoc/clean/inline.rs
Expand Up @@ -14,10 +14,9 @@ use std::collections::HashSet;
use std::iter::once;

use syntax::ast;
use syntax::attr::AttrMetaMethods;
use rustc::hir;

use rustc::middle::cstore::{self, CrateStore};
use rustc::middle::cstore;
use rustc::hir::def::Def;
use rustc::hir::def_id::DefId;
use rustc::ty::{self, TyCtxt};
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/clean/mod.rs
Expand Up @@ -35,7 +35,7 @@ use syntax::parse::token::{self, InternedString, keywords};
use syntax::ptr::P;

use rustc_trans::back::link;
use rustc::middle::cstore::{self, CrateStore};
use rustc::middle::cstore;
use rustc::middle::privacy::AccessLevels;
use rustc::hir::def::Def;
use rustc::hir::def_id::{DefId, DefIndex, CRATE_DEF_INDEX};
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/html/layout.rs
Expand Up @@ -9,7 +9,6 @@
// except according to those terms.

use std::fmt;
use std::io::prelude::*;
use std::io;

use externalfiles::ExternalHtml;
Expand Down
1 change: 0 additions & 1 deletion src/libstd/collections/hash/bench.rs
Expand Up @@ -11,7 +11,6 @@
#![cfg(test)]

extern crate test;
use prelude::v1::*;

use self::test::Bencher;

Expand Down
1 change: 0 additions & 1 deletion src/libstd/io/error.rs
Expand Up @@ -350,7 +350,6 @@ mod test {
use prelude::v1::*;
use super::{Error, ErrorKind};
use error;
use error::Error as error_Error;
use fmt;
use sys::os::error_string;

Expand Down
2 changes: 0 additions & 2 deletions src/tools/rustbook/main.rs
Expand Up @@ -19,10 +19,8 @@ extern crate rustdoc;
extern crate rustc_back;

use std::env;
use std::error::Error;
use std::process;
use std::sync::atomic::{AtomicIsize, ATOMIC_ISIZE_INIT, Ordering};
use subcommand::Subcommand;
use term::Term;

mod term;
Expand Down

0 comments on commit 7ad1900

Please sign in to comment.