From aef1e10eba812b8144b0a4ac8d9b6e690c6e5ca7 Mon Sep 17 00:00:00 2001 From: Daniel Farina Date: Thu, 30 May 2013 03:16:33 -0700 Subject: [PATCH] Remove unnecessary 'use' forms Fix a laundry list of warnings involving unused imports that glutted up compilation output. There are more, but there seems to be some false positives (where 'remedy' appears to break the build), but this particular set of fixes seems safe. --- src/libextra/bitv.rs | 3 +-- src/libextra/test.rs | 4 +--- src/libextra/uv_global_loop.rs | 4 +--- src/librustc/back/link.rs | 4 +--- src/librustc/back/passes.rs | 4 ++-- src/librustc/middle/trans/foreign.rs | 1 - src/librustc/middle/trans/glue.rs | 3 +-- src/librustc/middle/ty.rs | 1 - src/librustdoc/astsrv.rs | 5 +++-- src/librustdoc/extract.rs | 3 +-- src/librustdoc/markdown_writer.rs | 4 +--- src/librustdoc/unindent_pass.rs | 3 +-- src/libstd/cell.rs | 3 +-- src/libstd/iterator.rs | 1 - src/libstd/local_data.rs | 5 +++-- src/libstd/rand/distributions.rs | 1 - src/libstd/rt/task.rs | 1 - src/libstd/task/mod.rs | 10 +++++----- src/libstd/task/spawn.rs | 6 +++--- src/libstd/trie.rs | 2 -- src/libstd/unstable/mod.rs | 3 +-- src/libstd/util.rs | 1 - src/libsyntax/ext/pipes/ast_builder.rs | 3 +-- src/libsyntax/parse/parser.rs | 1 - src/libsyntax/parse/token.rs | 4 +--- 25 files changed, 28 insertions(+), 52 deletions(-) diff --git a/src/libextra/bitv.rs b/src/libextra/bitv.rs index 672a61b1ad8..0891d230810 100644 --- a/src/libextra/bitv.rs +++ b/src/libextra/bitv.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,7 +13,6 @@ use core::prelude::*; use core::cmp; use core::ops; use core::uint; -use core::vec::from_elem; use core::vec; struct SmallBitv { diff --git a/src/libextra/test.rs b/src/libextra/test.rs index 59c6a12e036..ddc8eb4430d 100644 --- a/src/libextra/test.rs +++ b/src/libextra/test.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -24,13 +24,11 @@ use term; use core::comm::{stream, SharedChan}; use core::either; use core::io; -use core::num; use core::option; use core::result; use core::str; use core::task; use core::to_str::ToStr; -use core::u64; use core::uint; use core::vec; diff --git a/src/libextra/uv_global_loop.rs b/src/libextra/uv_global_loop.rs index 8752f675a8d..286863bef64 100644 --- a/src/libextra/uv_global_loop.rs +++ b/src/libextra/uv_global_loop.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -16,9 +16,7 @@ use iotask = uv_iotask; use uv_iotask::{IoTask, spawn_iotask}; use core::comm::Chan; -use core::libc; use core::option::{Some, None}; -use core::str; use core::task::task; use core::unstable::global::{global_data_clone_create, global_data_clone}; use core::unstable::weak_task::weaken_task; diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 02c0b19e565..0695b88bb7f 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -106,9 +106,7 @@ pub mod jit { use metadata::cstore; use core::cast; - use core::char; use core::libc::c_int; - use core::os; use core::ptr; use core::str; diff --git a/src/librustc/back/passes.rs b/src/librustc/back/passes.rs index cc9fe577159..ffa551b21ba 100644 --- a/src/librustc/back/passes.rs +++ b/src/librustc/back/passes.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -12,7 +12,7 @@ use core::prelude::*; use core::str; use core::io; -use driver::session::{OptLevel, No, Less, Default, Aggressive}; +use driver::session::{OptLevel, No, Less, Aggressive}; use driver::session::{Session}; use lib::llvm::{PassRef, ModuleRef,PassManagerRef,TargetDataRef}; use lib::llvm::llvm; diff --git a/src/librustc/middle/trans/foreign.rs b/src/librustc/middle/trans/foreign.rs index a7a8cd088d2..196b4e5338f 100644 --- a/src/librustc/middle/trans/foreign.rs +++ b/src/librustc/middle/trans/foreign.rs @@ -34,7 +34,6 @@ use middle::ty; use middle::ty::FnSig; use util::ppaux::ty_to_str; -use core::str; use core::uint; use core::vec; use syntax::codemap::span; diff --git a/src/librustc/middle/trans/glue.rs b/src/librustc/middle/trans/glue.rs index 013a40c95c5..e2f7dc086d0 100644 --- a/src/librustc/middle/trans/glue.rs +++ b/src/librustc/middle/trans/glue.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -19,7 +19,6 @@ use back::link::*; use driver::session; use lib; use lib::llvm::{llvm, ValueRef, TypeRef, True}; -use lib::llvm::type_to_str; use middle::trans::adt; use middle::trans::base::*; use middle::trans::callee; diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 8815259b3cc..108ea333e1a 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -37,7 +37,6 @@ use core::to_bytes; use core::u32; use core::uint; use core::vec; -use extra::smallintmap::SmallIntMap; use syntax::ast::*; use syntax::ast_util::is_local; use syntax::ast_util; diff --git a/src/librustdoc/astsrv.rs b/src/librustdoc/astsrv.rs index 23810748b43..ae7968a4d46 100644 --- a/src/librustdoc/astsrv.rs +++ b/src/librustdoc/astsrv.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -24,7 +24,6 @@ use parse; use core::cell::Cell; use core::comm::{stream, SharedChan, Port}; use core::task; -use core::vec; use rustc::driver::driver; use rustc::driver::session::Session; use rustc::driver::session::{basic_options, options}; @@ -33,6 +32,8 @@ use syntax::ast; use syntax::ast_map; use syntax; +#[cfg(test)] use core::vec; + pub struct Ctxt { ast: @ast::crate, ast_map: ast_map::map diff --git a/src/librustdoc/extract.rs b/src/librustdoc/extract.rs index 3303a79d1b2..920a72077f0 100644 --- a/src/librustdoc/extract.rs +++ b/src/librustdoc/extract.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -16,7 +16,6 @@ use astsrv; use doc::ItemUtils; use doc; -use core::local_data::local_data_get; use core::vec; use syntax::ast; use syntax::parse::token::{ident_interner}; diff --git a/src/librustdoc/markdown_writer.rs b/src/librustdoc/markdown_writer.rs index 86b51dfabf0..7bcfa1acdfa 100644 --- a/src/librustdoc/markdown_writer.rs +++ b/src/librustdoc/markdown_writer.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -17,8 +17,6 @@ use doc; use core::comm::*; use core::comm; use core::io; -use core::libc; -use core::os; use core::result; use core::run; use core::str; diff --git a/src/librustdoc/unindent_pass.rs b/src/librustdoc/unindent_pass.rs index e78edf1fbf3..a7f195a35ee 100644 --- a/src/librustdoc/unindent_pass.rs +++ b/src/librustdoc/unindent_pass.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -22,7 +22,6 @@ middle of a line, and each of the following lines is indented. use core::prelude::*; use core::str; -use core::task; use core::uint; use core::vec; use pass::Pass; diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index f6d4e966db9..87145acbb62 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -11,7 +11,6 @@ //! A mutable, nullable memory location use cast::transmute_mut; -use cmp; use prelude::*; use util::replace; diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs index b13c4ca23e6..7be9e8c354e 100644 --- a/src/libstd/iterator.rs +++ b/src/libstd/iterator.rs @@ -20,7 +20,6 @@ implementing the `Iterator` trait. use cmp; use iter; use num::{Zero, One}; -use num; use prelude::*; /// An interface for dealing with "external iterators". These types of iterators diff --git a/src/libstd/local_data.rs b/src/libstd/local_data.rs index 6227f9ad388..82c01c998cf 100644 --- a/src/libstd/local_data.rs +++ b/src/libstd/local_data.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -29,7 +29,8 @@ magic. use prelude::*; use task::local_data_priv::{local_get, local_pop, local_modify, local_set, Handle}; -use task; + +#[cfg(test)] use task; /** * Indexes a task-local data slot. The function's code pointer is used for diff --git a/src/libstd/rand/distributions.rs b/src/libstd/rand/distributions.rs index a66e35f68df..cf2733976c4 100644 --- a/src/libstd/rand/distributions.rs +++ b/src/libstd/rand/distributions.rs @@ -21,7 +21,6 @@ // could implement VIZIGNOR the ZIGNOR paper for more speed. use f64; -use prelude::*; use rand::{Rng,Rand}; mod ziggurat_tables; diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index 12c683120c8..eb7282bae05 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -20,7 +20,6 @@ use prelude::*; use rt::local::Local; use rt::logging::StdErrLogger; use super::local_heap::LocalHeap; -use super::sched::Scheduler; pub struct Task { heap: LocalHeap, diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index 28fb73e6eef..b68abca8605 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -37,22 +37,22 @@ use prelude::*; -use cast; use cell::Cell; use cmp::Eq; use comm::{stream, Chan, GenericChan, GenericPort, Port}; -use comm; -use ptr; use result::Result; use result; use rt::{context, OldTaskContext}; use task::rt::{task_id, sched_id}; -use task; use unstable::finally::Finally; use util::replace; use util; +#[cfg(test)] use cast; #[cfg(test)] use comm::SharedChan; +#[cfg(test)] use comm; +#[cfg(test)] use ptr; +#[cfg(test)] use task; mod local_data_priv; pub mod rt; diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index 0b345b88d62..35cf6de3a15 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -79,7 +79,6 @@ use cast; use cell::Cell; use container::Map; use comm::{Chan, GenericChan}; -use comm; use ptr; use hashmap::HashSet; use task::local_data_priv::{local_get, local_set, OldHandle}; @@ -89,13 +88,14 @@ use task::{Failure, ManualThreads, PlatformThread, SchedOpts, SingleThreaded}; use task::{Success, TaskOpts, TaskResult, ThreadPerCore, ThreadPerTask}; use task::{ExistingScheduler, SchedulerHandle}; use task::unkillable; -use task; use uint; use util; use unstable::sync::{Exclusive, exclusive}; use rt::local::Local; #[cfg(test)] use task::default_task_opts; +#[cfg(test)] use comm; +#[cfg(test)] use task; macro_rules! move_it ( { $x:expr } => ( unsafe { let y = *ptr::to_unsafe_ptr(&($x)); y } ) diff --git a/src/libstd/trie.rs b/src/libstd/trie.rs index 460f29d597a..e5b1385974e 100644 --- a/src/libstd/trie.rs +++ b/src/libstd/trie.rs @@ -10,8 +10,6 @@ //! An ordered map and set for integer keys implemented as a radix trie -use local_data; -use os; use prelude::*; use uint; use util::{swap, replace}; diff --git a/src/libstd/unstable/mod.rs b/src/libstd/unstable/mod.rs index 1f73aa02b01..1e226da271d 100644 --- a/src/libstd/unstable/mod.rs +++ b/src/libstd/unstable/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -14,7 +14,6 @@ use comm::{GenericChan, GenericPort}; use comm; use libc; use prelude::*; -use ptr; use task; pub mod at_exit; diff --git a/src/libstd/util.rs b/src/libstd/util.rs index 18fc6af3ac6..2b61356129e 100644 --- a/src/libstd/util.rs +++ b/src/libstd/util.rs @@ -11,7 +11,6 @@ //! Miscellaneous helpers for common patterns. use cast; -use local_data; use ptr; use prelude::*; use unstable::intrinsics; diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 37d5e0206cb..08f1540918e 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -19,7 +19,6 @@ use ast::ident; use ast; use codemap::span; -use core::str; use core::vec; // Transitional reexports so qquote can find the paths it is looking for diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 27dfc2c0a46..208ed1c41c8 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -92,7 +92,6 @@ use parse::{new_sub_parser_from_file, next_node_id, ParseSess}; use opt_vec; use opt_vec::OptVec; -use core::char; use core::either::Either; use core::either; use core::hashmap::HashSet; diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index b1a385ada07..f50b9f8936a 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -19,11 +19,9 @@ use util::interner; use core::cast; use core::char; use core::cmp::Equiv; -use core::hashmap::HashSet; use core::local_data; use core::str; use core::to_bytes; -use core::vec; #[deriving(Encodable, Decodable, Eq)] pub enum binop {