about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2015-01-26 22:56:50 -0500
committerJorge Aparicio <japaricious@gmail.com>2015-01-27 22:58:45 -0500
commit57dd4ea78d527f1c81f6009d0132bf210dd8fdfd (patch)
treee902970781d79e775f3c6599f1f845eadf17582b /src
parent92ff8ea52816982ad4cbfac8168e216d32d74c77 (diff)
downloadrust-57dd4ea78d527f1c81f6009d0132bf210dd8fdfd.tar.gz
rust-57dd4ea78d527f1c81f6009d0132bf210dd8fdfd.zip
fix #[cfg(test)] warnings
Diffstat (limited to 'src')
-rw-r--r--src/liballoc/heap.rs1
-rw-r--r--src/libfmt_macros/lib.rs2
-rw-r--r--src/librustc_back/rpath.rs1
-rw-r--r--src/libserialize/json.rs3
-rw-r--r--src/libsyntax/ext/expand.rs5
-rw-r--r--src/libsyntax/print/pprust.rs1
-rw-r--r--src/libtest/lib.rs3
7 files changed, 5 insertions, 11 deletions
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs
index a2643f4d0f7..c87d789901b 100644
--- a/src/liballoc/heap.rs
+++ b/src/liballoc/heap.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#[cfg(not(test))]
 use core::ptr::PtrExt;
 
 // FIXME: #13996: mark the `allocate` and `reallocate` return value as `noalias`
diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs
index 0ff15327441..57b4a67de36 100644
--- a/src/libfmt_macros/lib.rs
+++ b/src/libfmt_macros/lib.rs
@@ -444,7 +444,7 @@ mod tests {
     use super::*;
 
     fn same(fmt: &'static str, p: &[Piece<'static>]) {
-        let mut parser = Parser::new(fmt);
+        let parser = Parser::new(fmt);
         assert!(p == parser.collect::<Vec<Piece<'static>>>());
     }
 
diff --git a/src/librustc_back/rpath.rs b/src/librustc_back/rpath.rs
index bafd5fbe944..47b909df5e8 100644
--- a/src/librustc_back/rpath.rs
+++ b/src/librustc_back/rpath.rs
@@ -151,7 +151,6 @@ fn minimize_rpaths(rpaths: &[String]) -> Vec<String> {
 mod test {
     use super::{RPathConfig};
     use super::{minimize_rpaths, rpaths_to_flags, get_rpath_relative_to_output};
-    use syntax::abi;
 
     #[test]
     fn test_rpaths_to_flags() {
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs
index dad72fbd0e3..f6c76f2c7b8 100644
--- a/src/libserialize/json.rs
+++ b/src/libserialize/json.rs
@@ -2618,7 +2618,7 @@ mod tests {
     use super::JsonEvent::*;
     use super::{Json, from_str, DecodeResult, DecoderError, JsonEvent, Parser,
                 StackElement, Stack, Decoder, Encoder, EncoderError};
-    use std::{i64, u64, f32, f64, old_io};
+    use std::{i64, u64, f32, f64};
     use std::collections::BTreeMap;
     use std::num::Float;
     use std::string;
@@ -3928,7 +3928,6 @@ mod tests {
 
     #[test]
     fn test_encode_hashmap_with_arbitrary_key() {
-        use std::str::from_utf8;
         use std::old_io::Writer;
         use std::collections::HashMap;
         use std::fmt;
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index 629991799e7..acf0fe7f6cd 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -1433,15 +1433,12 @@ mod test {
     use super::{pattern_bindings, expand_crate};
     use super::{PatIdentFinder, IdentRenamer, PatIdentRenamer, ExpansionConfig};
     use ast;
-    use ast::{Attribute_, AttrOuter, MetaWord, Name};
-    use attr;
+    use ast::Name;
     use codemap;
-    use codemap::Spanned;
     use ext::mtwt;
     use fold::Folder;
     use parse;
     use parse::token;
-    use ptr::P;
     use util::parser_testing::{string_to_parser};
     use util::parser_testing::{string_to_pat, string_to_crate, strs_to_idents};
     use visit;
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index ae3c4addf38..f9a202523b5 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -2975,7 +2975,6 @@ mod test {
     use ast_util;
     use codemap;
     use parse::token;
-    use ptr::P;
 
     #[test]
     fn test_fun_to_string() {
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index 2e59b15b6d9..0f3d84ae6ea 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -1118,9 +1118,8 @@ pub mod bench {
 mod tests {
     use test::{TrFailed, TrIgnored, TrOk, filter_tests, parse_opts,
                TestDesc, TestDescAndFn, TestOpts, run_test,
-               Metric, MetricMap,
+               MetricMap,
                StaticTestName, DynTestName, DynTestFn, ShouldFail};
-    use std::old_io::TempDir;
     use std::thunk::Thunk;
     use std::sync::mpsc::channel;