Skip to content

Commit aef1e10

Browse files
committed
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.
1 parent a394298 commit aef1e10

File tree

25 files changed

+28
-52
lines changed

25 files changed

+28
-52
lines changed

src/libextra/bitv.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -13,7 +13,6 @@ use core::prelude::*;
1313
use core::cmp;
1414
use core::ops;
1515
use core::uint;
16-
use core::vec::from_elem;
1716
use core::vec;
1817

1918
struct SmallBitv {

src/libextra/test.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -24,13 +24,11 @@ use term;
2424
use core::comm::{stream, SharedChan};
2525
use core::either;
2626
use core::io;
27-
use core::num;
2827
use core::option;
2928
use core::result;
3029
use core::str;
3130
use core::task;
3231
use core::to_str::ToStr;
33-
use core::u64;
3432
use core::uint;
3533
use core::vec;
3634

src/libextra/uv_global_loop.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -16,9 +16,7 @@ use iotask = uv_iotask;
1616
use uv_iotask::{IoTask, spawn_iotask};
1717

1818
use core::comm::Chan;
19-
use core::libc;
2019
use core::option::{Some, None};
21-
use core::str;
2220
use core::task::task;
2321
use core::unstable::global::{global_data_clone_create, global_data_clone};
2422
use core::unstable::weak_task::weaken_task;

src/librustc/back/link.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -106,9 +106,7 @@ pub mod jit {
106106
use metadata::cstore;
107107

108108
use core::cast;
109-
use core::char;
110109
use core::libc::c_int;
111-
use core::os;
112110
use core::ptr;
113111
use core::str;
114112

src/librustc/back/passes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -12,7 +12,7 @@ use core::prelude::*;
1212
use core::str;
1313
use core::io;
1414

15-
use driver::session::{OptLevel, No, Less, Default, Aggressive};
15+
use driver::session::{OptLevel, No, Less, Aggressive};
1616
use driver::session::{Session};
1717
use lib::llvm::{PassRef, ModuleRef,PassManagerRef,TargetDataRef};
1818
use lib::llvm::llvm;

src/librustc/middle/trans/foreign.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use middle::ty;
3434
use middle::ty::FnSig;
3535
use util::ppaux::ty_to_str;
3636

37-
use core::str;
3837
use core::uint;
3938
use core::vec;
4039
use syntax::codemap::span;

src/librustc/middle/trans/glue.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -19,7 +19,6 @@ use back::link::*;
1919
use driver::session;
2020
use lib;
2121
use lib::llvm::{llvm, ValueRef, TypeRef, True};
22-
use lib::llvm::type_to_str;
2322
use middle::trans::adt;
2423
use middle::trans::base::*;
2524
use middle::trans::callee;

src/librustc/middle/ty.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use core::to_bytes;
3737
use core::u32;
3838
use core::uint;
3939
use core::vec;
40-
use extra::smallintmap::SmallIntMap;
4140
use syntax::ast::*;
4241
use syntax::ast_util::is_local;
4342
use syntax::ast_util;

src/librustdoc/astsrv.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -24,7 +24,6 @@ use parse;
2424
use core::cell::Cell;
2525
use core::comm::{stream, SharedChan, Port};
2626
use core::task;
27-
use core::vec;
2827
use rustc::driver::driver;
2928
use rustc::driver::session::Session;
3029
use rustc::driver::session::{basic_options, options};
@@ -33,6 +32,8 @@ use syntax::ast;
3332
use syntax::ast_map;
3433
use syntax;
3534

35+
#[cfg(test)] use core::vec;
36+
3637
pub struct Ctxt {
3738
ast: @ast::crate,
3839
ast_map: ast_map::map

src/librustdoc/extract.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -16,7 +16,6 @@ use astsrv;
1616
use doc::ItemUtils;
1717
use doc;
1818

19-
use core::local_data::local_data_get;
2019
use core::vec;
2120
use syntax::ast;
2221
use syntax::parse::token::{ident_interner};

src/librustdoc/markdown_writer.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -17,8 +17,6 @@ use doc;
1717
use core::comm::*;
1818
use core::comm;
1919
use core::io;
20-
use core::libc;
21-
use core::os;
2220
use core::result;
2321
use core::run;
2422
use core::str;

src/librustdoc/unindent_pass.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -22,7 +22,6 @@ middle of a line, and each of the following lines is indented.
2222
use core::prelude::*;
2323

2424
use core::str;
25-
use core::task;
2625
use core::uint;
2726
use core::vec;
2827
use pass::Pass;

src/libstd/cell.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -11,7 +11,6 @@
1111
//! A mutable, nullable memory location
1212
1313
use cast::transmute_mut;
14-
use cmp;
1514
use prelude::*;
1615
use util::replace;
1716

src/libstd/iterator.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ implementing the `Iterator` trait.
2020
use cmp;
2121
use iter;
2222
use num::{Zero, One};
23-
use num;
2423
use prelude::*;
2524

2625
/// An interface for dealing with "external iterators". These types of iterators

src/libstd/local_data.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -29,7 +29,8 @@ magic.
2929
use prelude::*;
3030

3131
use task::local_data_priv::{local_get, local_pop, local_modify, local_set, Handle};
32-
use task;
32+
33+
#[cfg(test)] use task;
3334

3435
/**
3536
* Indexes a task-local data slot. The function's code pointer is used for

src/libstd/rand/distributions.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// could implement VIZIGNOR the ZIGNOR paper for more speed.
2222

2323
use f64;
24-
use prelude::*;
2524
use rand::{Rng,Rand};
2625

2726
mod ziggurat_tables;

src/libstd/rt/task.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use prelude::*;
2020
use rt::local::Local;
2121
use rt::logging::StdErrLogger;
2222
use super::local_heap::LocalHeap;
23-
use super::sched::Scheduler;
2423

2524
pub struct Task {
2625
heap: LocalHeap,

src/libstd/task/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -37,22 +37,22 @@
3737

3838
use prelude::*;
3939

40-
use cast;
4140
use cell::Cell;
4241
use cmp::Eq;
4342
use comm::{stream, Chan, GenericChan, GenericPort, Port};
44-
use comm;
45-
use ptr;
4643
use result::Result;
4744
use result;
4845
use rt::{context, OldTaskContext};
4946
use task::rt::{task_id, sched_id};
50-
use task;
5147
use unstable::finally::Finally;
5248
use util::replace;
5349
use util;
5450

51+
#[cfg(test)] use cast;
5552
#[cfg(test)] use comm::SharedChan;
53+
#[cfg(test)] use comm;
54+
#[cfg(test)] use ptr;
55+
#[cfg(test)] use task;
5656

5757
mod local_data_priv;
5858
pub mod rt;

src/libstd/task/spawn.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -79,7 +79,6 @@ use cast;
7979
use cell::Cell;
8080
use container::Map;
8181
use comm::{Chan, GenericChan};
82-
use comm;
8382
use ptr;
8483
use hashmap::HashSet;
8584
use task::local_data_priv::{local_get, local_set, OldHandle};
@@ -89,13 +88,14 @@ use task::{Failure, ManualThreads, PlatformThread, SchedOpts, SingleThreaded};
8988
use task::{Success, TaskOpts, TaskResult, ThreadPerCore, ThreadPerTask};
9089
use task::{ExistingScheduler, SchedulerHandle};
9190
use task::unkillable;
92-
use task;
9391
use uint;
9492
use util;
9593
use unstable::sync::{Exclusive, exclusive};
9694
use rt::local::Local;
9795

9896
#[cfg(test)] use task::default_task_opts;
97+
#[cfg(test)] use comm;
98+
#[cfg(test)] use task;
9999

100100
macro_rules! move_it (
101101
{ $x:expr } => ( unsafe { let y = *ptr::to_unsafe_ptr(&($x)); y } )

src/libstd/trie.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
//! An ordered map and set for integer keys implemented as a radix trie
1212
13-
use local_data;
14-
use os;
1513
use prelude::*;
1614
use uint;
1715
use util::{swap, replace};

src/libstd/unstable/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -14,7 +14,6 @@ use comm::{GenericChan, GenericPort};
1414
use comm;
1515
use libc;
1616
use prelude::*;
17-
use ptr;
1817
use task;
1918

2019
pub mod at_exit;

src/libstd/util.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//! Miscellaneous helpers for common patterns.
1212
1313
use cast;
14-
use local_data;
1514
use ptr;
1615
use prelude::*;
1716
use unstable::intrinsics;

src/libsyntax/ext/pipes/ast_builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -19,7 +19,6 @@ use ast::ident;
1919
use ast;
2020
use codemap::span;
2121

22-
use core::str;
2322
use core::vec;
2423

2524
// Transitional reexports so qquote can find the paths it is looking for

src/libsyntax/parse/parser.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ use parse::{new_sub_parser_from_file, next_node_id, ParseSess};
9292
use opt_vec;
9393
use opt_vec::OptVec;
9494

95-
use core::char;
9695
use core::either::Either;
9796
use core::either;
9897
use core::hashmap::HashSet;

src/libsyntax/parse/token.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -19,11 +19,9 @@ use util::interner;
1919
use core::cast;
2020
use core::char;
2121
use core::cmp::Equiv;
22-
use core::hashmap::HashSet;
2322
use core::local_data;
2423
use core::str;
2524
use core::to_bytes;
26-
use core::vec;
2725

2826
#[deriving(Encodable, Decodable, Eq)]
2927
pub enum binop {

0 commit comments

Comments
 (0)