about summary refs log tree commit diff
path: root/src/libsyntax/parse
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/parse
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/parse')
-rw-r--r--src/libsyntax/parse/attr.rs4
-rw-r--r--src/libsyntax/parse/classify.rs1
-rw-r--r--src/libsyntax/parse/comments.rs1
-rw-r--r--src/libsyntax/parse/common.rs2
-rw-r--r--src/libsyntax/parse/lexer.rs2
-rw-r--r--src/libsyntax/parse/mod.rs2
-rw-r--r--src/libsyntax/parse/obsolete.rs2
-rw-r--r--src/libsyntax/parse/parser.rs7
8 files changed, 0 insertions, 21 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs
index 824a3e6f880..bf8f03d4bf6 100644
--- a/src/libsyntax/parse/attr.rs
+++ b/src/libsyntax/parse/attr.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use core::prelude::*;
-
 use ast;
 use codemap::spanned;
 use codemap::BytePos;
@@ -17,8 +15,6 @@ use parse::common::*; //resolve bug?
 use parse::token;
 use parse::parser::Parser;
 
-use core::either::{Either, Left, Right};
-
 // a parser that can parse attributes.
 pub trait parser_attr {
     fn parse_outer_attributes(&self) -> ~[ast::attribute];
diff --git a/src/libsyntax/parse/classify.rs b/src/libsyntax/parse/classify.rs
index 64c4cb3c508..4125a0bc3b4 100644
--- a/src/libsyntax/parse/classify.rs
+++ b/src/libsyntax/parse/classify.rs
@@ -14,7 +14,6 @@
 
 use ast;
 use codemap;
-use ast_util::operator_prec;
 
 pub fn expr_requires_semi_to_be_stmt(e: @ast::expr) -> bool {
     match e.node {
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs
index 714ae9a0fd5..ca5c4564dd9 100644
--- a/src/libsyntax/parse/comments.rs
+++ b/src/libsyntax/parse/comments.rs
@@ -19,7 +19,6 @@ use parse::lexer::{is_line_non_doc_comment, is_block_non_doc_comment};
 use parse::lexer;
 use parse::token;
 use parse;
-use util::interner;
 
 use core::cmp;
 use core::io::ReaderUtil;
diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs
index 0abec79ee5d..cdeb9b2f647 100644
--- a/src/libsyntax/parse/common.rs
+++ b/src/libsyntax/parse/common.rs
@@ -17,8 +17,6 @@ use parse::parser::Parser;
 use parse::token;
 
 use core::option::{None, Option, Some};
-use core::option;
-use std::oldmap::HashMap;
 
 use opt_vec;
 use opt_vec::OptVec;
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index ed71fa411c6..524f9b48dd5 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -11,7 +11,6 @@
 use core::prelude::*;
 
 use ast;
-use ast_util;
 use codemap::{BytePos, CharPos, CodeMap, Pos, span};
 use codemap;
 use diagnostic::span_handler;
@@ -780,7 +779,6 @@ pub mod test {
     use core::option::None;
     use diagnostic;
     use parse::token;
-    use util::interner;
     use util::testing::{check_equal, check_equal_ptr};
 
     // represents a testing reader (incl. both reader and interner)
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs
index 887f064018f..96a8f780934 100644
--- a/src/libsyntax/parse/mod.rs
+++ b/src/libsyntax/parse/mod.rs
@@ -20,13 +20,11 @@ use parse::attr::parser_attr;
 use parse::lexer::{reader, StringReader};
 use parse::parser::Parser;
 use parse::token::{ident_interner, mk_ident_interner};
-use util::interner;
 
 use core::io;
 use core::option::{None, Option, Some};
 use core::path::Path;
 use core::result::{Err, Ok, Result};
-use core::result;
 
 pub mod lexer;
 pub mod parser;
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index 4ca7c1ec888..93d3d952cdd 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -26,8 +26,6 @@ use parse::parser::Parser;
 use parse::token::Token;
 use parse::token;
 
-use core::cmp;
-use core::option;
 use core::str;
 use core::to_bytes;
 
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 0d0d23e0cd0..dd179171fce 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -57,7 +57,6 @@ use ast::{unnamed_field, unsafe_blk, unsafe_fn, variant, view_item};
 use ast::{view_item_, view_item_extern_mod, view_item_use};
 use ast::{view_path, view_path_glob, view_path_list, view_path_simple};
 use ast::{visibility, vstore, vstore_box, vstore_fixed, vstore_slice};
-use ast::{vstore_uniq};
 use ast;
 use ast_util::{ident_to_path, operator_prec};
 use ast_util;
@@ -72,7 +71,6 @@ use parse::lexer::TokenAndSpan;
 use parse::obsolete::{ObsoleteClassTraits, ObsoleteModeInFnType};
 use parse::obsolete::{ObsoleteLet, ObsoleteFieldTerminator};
 use parse::obsolete::{ObsoleteMoveInit, ObsoleteBinaryMove};
-use parse::obsolete::{ObsoleteStructCtor, ObsoleteWith};
 use parse::obsolete::{ObsoleteSyntax, ObsoleteLowerCaseKindBounds};
 use parse::obsolete::{ObsoleteUnsafeBlock, ObsoleteImplSyntax};
 use parse::obsolete::{ObsoleteTraitBoundSeparator, ObsoleteMutOwnedPointer};
@@ -82,16 +80,11 @@ use parse::token::{can_begin_expr, is_ident, is_ident_or_path};
 use parse::token::{is_plain_ident, INTERPOLATED, special_idents};
 use parse::token;
 use parse::{new_sub_parser_from_file, next_node_id, ParseSess};
-use print::pprust::expr_to_str;
-use util::interner::Interner;
 use opt_vec;
 use opt_vec::OptVec;
 
-use core::cmp;
 use core::either::{Either, Left, Right};
 use core::either;
-use core::result::Result;
-use core::vec::push;
 use core::vec;
 use std::oldmap::HashMap;