about summary refs log tree commit diff
path: root/src/compiletest
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-03-05 00:57:46 -0800
committerbors <bors@rust-lang.org>2013-03-05 00:57:46 -0800
commit75c5bc90d2d3fb3e495b38c49c7cc96797795c72 (patch)
treeb01a9f1428b1b3ed4fa126a9c8d5cbbe8056f3ce /src/compiletest
parent71f09813c86ad4d78d7760f4fcc8659f12532e63 (diff)
parentcb4ab76e4a17e0efc6b506af15fd1df654c043ff (diff)
auto merge of #5179 : alexcrichton/rust/default-warn-unused-import, r=graydon
I've found that unused imports can often start cluttering a project after a long time, and it's very useful to keep them under control. I don't like how Go forces a compiler error by default and it can't be changed, but I certainly want to know about them so I think that a warn is a good default.

Now that the `unused_imports` lint option is a bit smarter, I think it's possible to change the default level to warn. This commit also removes all unused imports throughout the compiler and libraries (500+).

The only odd things that I ran into were that some `use` statements had to have `#[cfg(notest)]` or `#[cfg(test)]` based on where they were. The ones with `notest` were mostly in core for modules like `cmp` whereas `cfg(test)` was for tests that weren't part of a normal `mod test` module. 
Diffstat (limited to 'src/compiletest')
-rw-r--r--src/compiletest/common.rs2
-rw-r--r--src/compiletest/compiletest.rc1
-rw-r--r--src/compiletest/errors.rs2
-rw-r--r--src/compiletest/procsrv.rs3
-rw-r--r--src/compiletest/runtest.rs2
-rw-r--r--src/compiletest/util.rs2
6 files changed, 0 insertions, 12 deletions
diff --git a/src/compiletest/common.rs b/src/compiletest/common.rs
index 0facf9d63c3..b7c4e26c4b1 100644
--- a/src/compiletest/common.rs
+++ b/src/compiletest/common.rs
@@ -10,8 +10,6 @@
 
 use core::prelude::*;
 
-use cmp;
-
 #[deriving_eq]
 pub enum mode {
     mode_compile_fail,
diff --git a/src/compiletest/compiletest.rc b/src/compiletest/compiletest.rc
index bccaf0ddf60..531e2329b0e 100644
--- a/src/compiletest/compiletest.rc
+++ b/src/compiletest/compiletest.rc
@@ -32,7 +32,6 @@ pub mod errors;
 use std::getopts;
 use std::test;
 
-use core::{result, either};
 use core::result::{Ok, Err};
 
 use common::config;
diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs
index 39b70299ba5..16af0a4b575 100644
--- a/src/compiletest/errors.rs
+++ b/src/compiletest/errors.rs
@@ -10,8 +10,6 @@
 
 use core::prelude::*;
 
-use common::config;
-
 use core::io;
 use core::io::ReaderUtil;
 use core::str;
diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs
index 8d8cdb3c719..f11e0ba74b6 100644
--- a/src/compiletest/procsrv.rs
+++ b/src/compiletest/procsrv.rs
@@ -13,14 +13,11 @@ use core::prelude::*;
 use core::io::{ReaderUtil, WriterUtil};
 use core::io;
 use core::libc::{c_int, pid_t};
-use core::libc;
 use core::os;
-use core::pipes;
 use core::run::spawn_process;
 use core::run;
 use core::str;
 use core::task;
-use core::vec;
 
 #[cfg(target_os = "win32")]
 fn target_env(lib_path: ~str, prog: ~str) -> ~[(~str,~str)] {
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index b5def15fc50..e0db543250d 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -10,14 +10,12 @@
 
 use core::prelude::*;
 
-use common;
 use common::mode_run_pass;
 use common::mode_run_fail;
 use common::mode_compile_fail;
 use common::mode_pretty;
 use common::config;
 use errors;
-use header;
 use header::load_props;
 use header::TestProps;
 use procsrv;
diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs
index ad60e532f3c..736c20969e9 100644
--- a/src/compiletest/util.rs
+++ b/src/compiletest/util.rs
@@ -10,12 +10,10 @@
 
 use core::prelude::*;
 
-use common;
 use common::config;
 
 use core::io;
 use core::os::getenv;
-use core::os;
 
 pub fn make_new_path(path: ~str) -> ~str {