summary refs log tree commit diff
path: root/src/libsyntax/ext
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/libsyntax/ext
parent71f09813c86ad4d78d7760f4fcc8659f12532e63 (diff)
parentcb4ab76e4a17e0efc6b506af15fd1df654c043ff (diff)
downloadrust-75c5bc90d2d3fb3e495b38c49c7cc96797795c72.tar.gz
rust-75c5bc90d2d3fb3e495b38c49c7cc96797795c72.zip
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/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/auto_encode.rs9
-rw-r--r--src/libsyntax/ext/base.rs2
-rw-r--r--src/libsyntax/ext/build.rs2
-rw-r--r--src/libsyntax/ext/deriving.rs1
-rw-r--r--src/libsyntax/ext/expand.rs1
-rw-r--r--src/libsyntax/ext/pipes/ast_builder.rs2
-rw-r--r--src/libsyntax/ext/pipes/mod.rs1
-rw-r--r--src/libsyntax/ext/pipes/parse_proto.rs1
-rw-r--r--src/libsyntax/ext/pipes/pipec.rs6
-rw-r--r--src/libsyntax/ext/pipes/proto.rs1
-rw-r--r--src/libsyntax/ext/quote.rs3
-rw-r--r--src/libsyntax/ext/trace_macros.rs1
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs3
-rw-r--r--src/libsyntax/ext/tt/macro_rules.rs1
-rw-r--r--src/libsyntax/ext/tt/transcribe.rs2
15 files changed, 1 insertions, 35 deletions
diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs
index b0dcdf2e664..644afaff37c 100644
--- a/src/libsyntax/ext/auto_encode.rs
+++ b/src/libsyntax/ext/auto_encode.rs
@@ -102,8 +102,6 @@ use opt_vec::OptVec;
 use ext::build;
 
 use core::vec;
-use std::oldmap;
-use std::oldmap::HashMap;
 
 // Transitional reexports so qquote can find the paths it is looking for
 mod syntax {
@@ -1208,14 +1206,7 @@ fn mk_enum_deser_body(
 mod test {
     use std::serialize::Encodable;
     use std::serialize::Encoder;
-    use core::dvec::*;
     use util::testing::*;
-    use core::io;
-    use core::str;
-    use core::option::Option;
-    use core::option::Some;
-    use core::option::None;
-    use std;
 
     // just adding the ones I want to test, for now:
     #[deriving_eq]
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index 01439fb40fb..23cabc09946 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -19,7 +19,6 @@ use ext;
 use parse;
 use parse::{parser, token};
 
-use core::io;
 use core::vec;
 use core::hashmap::linear::LinearMap;
 
@@ -504,7 +503,6 @@ impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{
 
 #[cfg(test)]
 mod test {
-    use super::*;
     use super::MapChain;
     use util::testing::check_equal;
     use core::hashmap::linear::LinearMap;
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index c6e6e677348..a42564ff2ec 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -16,10 +16,8 @@ use codemap::span;
 use ext::base::ext_ctxt;
 use ext::build;
 
-use opt_vec;
 use opt_vec::OptVec;
 
-use core::dvec;
 use core::option;
 
 pub struct Field {
diff --git a/src/libsyntax/ext/deriving.rs b/src/libsyntax/ext/deriving.rs
index f5dbf269138..07896236442 100644
--- a/src/libsyntax/ext/deriving.rs
+++ b/src/libsyntax/ext/deriving.rs
@@ -28,7 +28,6 @@ use codemap::{span, spanned};
 use parse::token::special_idents::clownshoes_extensions;
 use ast_util;
 use opt_vec;
-use opt_vec::OptVec;
 
 use core::dvec;
 use core::uint;
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index 858ce4b17a3..97c75e65e1d 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -24,7 +24,6 @@ use parse::{parser, parse_item_from_source_str, new_parser_from_tts};
 
 use core::option;
 use core::vec;
-use core::hashmap::LinearMap;
 
 pub fn expand_expr(extsbox: @mut SyntaxEnv,
                    cx: ext_ctxt,
diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs
index 3b885b7a7b9..e6f0cdde8c1 100644
--- a/src/libsyntax/ext/pipes/ast_builder.rs
+++ b/src/libsyntax/ext/pipes/ast_builder.rs
@@ -17,9 +17,7 @@ use core::prelude::*;
 
 use ast::{ident, node_id};
 use ast;
-use ast_util::{ident_to_path};
 use ast_util;
-use attr;
 use codemap::{span, respan, dummy_sp, spanned};
 use codemap;
 use ext::base::{ext_ctxt, mk_ctxt};
diff --git a/src/libsyntax/ext/pipes/mod.rs b/src/libsyntax/ext/pipes/mod.rs
index c26bfd178b0..df17c960ba2 100644
--- a/src/libsyntax/ext/pipes/mod.rs
+++ b/src/libsyntax/ext/pipes/mod.rs
@@ -44,7 +44,6 @@ FIXME (#3072) - This is still incomplete.
 */
 
 use ast;
-use ast::tt_delim;
 use codemap::span;
 use ext::base;
 use ext::base::ext_ctxt;
diff --git a/src/libsyntax/ext/pipes/parse_proto.rs b/src/libsyntax/ext/pipes/parse_proto.rs
index a5ca24c6737..0725f288949 100644
--- a/src/libsyntax/ext/pipes/parse_proto.rs
+++ b/src/libsyntax/ext/pipes/parse_proto.rs
@@ -11,7 +11,6 @@
 // Parsing pipes protocols from token trees.
 
 use ast_util;
-use ext::pipes::pipec::*;
 use ext::pipes::proto::*;
 use parse::common::SeqSep;
 use parse::parser;
diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs
index 968a0e5f77e..5ea9257d583 100644
--- a/src/libsyntax/ext/pipes/pipec.rs
+++ b/src/libsyntax/ext/pipes/pipec.rs
@@ -11,19 +11,15 @@
 // A protocol compiler for Rust.
 
 use ast;
-use ast::ident;
 use codemap::{dummy_sp, spanned};
 use ext::base::ext_ctxt;
 use ext::pipes::ast_builder::{append_types, ext_ctxt_ast_builder, path};
 use ext::pipes::ast_builder::{path_global};
 use ext::pipes::proto::*;
 use ext::quote::rt::*;
-use parse::*;
-use util::interner;
 use opt_vec;
 use opt_vec::OptVec;
 
-use core::dvec::DVec;
 use core::prelude::*;
 use core::str;
 use core::to_str::ToStr;
@@ -342,7 +338,7 @@ impl gen_init for protocol {
         };
 
         cx.parse_item(fmt!("pub fn init%s() -> (client::%s, server::%s)\
-                            { use core::pipes::HasBuffer; %s }",
+                            { pub use core::pipes::HasBuffer; %s }",
                            start_state.generics.to_source(cx),
                            start_state.to_ty(cx).to_source(cx),
                            start_state.to_ty(cx).to_source(cx),
diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs
index db5c6541e26..329b3f59b1e 100644
--- a/src/libsyntax/ext/pipes/proto.rs
+++ b/src/libsyntax/ext/pipes/proto.rs
@@ -15,7 +15,6 @@ use codemap::span;
 use ext::base::ext_ctxt;
 use ext::pipes::ast_builder::{append_types, ext_ctxt_ast_builder, path};
 
-use core::cmp;
 use core::to_str::ToStr;
 
 #[deriving_eq]
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs
index 7b00a5e5a4b..49d5ed1d0cc 100644
--- a/src/libsyntax/ext/quote.rs
+++ b/src/libsyntax/ext/quote.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 use ast;
-use attr;
 use codemap::{BytePos, Pos, span};
 use ext::base::ext_ctxt;
 use ext::base;
@@ -19,7 +18,6 @@ use parse::token;
 use parse;
 
 use core::prelude::*;
-use core::str;
 
 /**
 *
@@ -34,7 +32,6 @@ use core::str;
 
 pub mod rt {
     use ast;
-    use codemap;
     use ext::base::ext_ctxt;
     use parse;
     use print::pprust;
diff --git a/src/libsyntax/ext/trace_macros.rs b/src/libsyntax/ext/trace_macros.rs
index d7f7f7c6510..b53523f78a4 100644
--- a/src/libsyntax/ext/trace_macros.rs
+++ b/src/libsyntax/ext/trace_macros.rs
@@ -10,7 +10,6 @@
 
 use core::prelude::*;
 
-use ast::tt_delim;
 use ast;
 use codemap::span;
 use ext::base::ext_ctxt;
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index 004acd40691..0e63ea3278e 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -13,7 +13,6 @@ use ast;
 use ast::{matcher, match_tok, match_seq, match_nonterminal, ident};
 use codemap::{BytePos, mk_sp};
 use codemap;
-use parse::common::*; //resolve bug?
 use parse::lexer::*; //resolve bug?
 use parse::ParseSess;
 use parse::parser::Parser;
@@ -22,8 +21,6 @@ use parse::token;
 
 use core::dvec::DVec;
 use core::dvec;
-use core::io;
-use core::option;
 use core::option::{Option, Some, None};
 use core::str;
 use core::uint;
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs
index 370b838ab41..e5b7152bea2 100644
--- a/src/libsyntax/ext/tt/macro_rules.rs
+++ b/src/libsyntax/ext/tt/macro_rules.rs
@@ -26,7 +26,6 @@ use parse::token::{FAT_ARROW, SEMI, LBRACE, RBRACE, nt_matchers, nt_tt};
 use print;
 
 use core::io;
-use std::oldmap::HashMap;
 
 pub fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
                          arg: ~[ast::token_tree]) -> base::MacResult {
diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs
index 443c0b40390..79264f7adf0 100644
--- a/src/libsyntax/ext/tt/transcribe.rs
+++ b/src/libsyntax/ext/tt/transcribe.rs
@@ -12,7 +12,6 @@ use core::prelude::*;
 
 use ast;
 use ast::{token_tree, tt_delim, tt_tok, tt_seq, tt_nonterminal,ident};
-use ast_util;
 use codemap::{span, dummy_sp};
 use diagnostic::span_handler;
 use ext::tt::macro_parser::{named_match, matched_seq, matched_nonterminal};
@@ -22,7 +21,6 @@ use parse::lexer::TokenAndSpan;
 use core::option;
 use core::vec;
 use std;
-use std::oldmap::HashMap;
 
 /* FIXME #2811: figure out how to have a uniquely linked stack, and change to
    `~` */