]> git.lizzy.rs Git - rust.git/commitdiff
fix #[cfg(test)] warnings
authorJorge Aparicio <japaricious@gmail.com>
Tue, 27 Jan 2015 03:56:50 +0000 (22:56 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Wed, 28 Jan 2015 03:58:45 +0000 (22:58 -0500)
src/liballoc/heap.rs
src/libfmt_macros/lib.rs
src/librustc_back/rpath.rs
src/libserialize/json.rs
src/libsyntax/ext/expand.rs
src/libsyntax/print/pprust.rs
src/libtest/lib.rs

index a2643f4d0f79b5e6d752ead894a9c29068a531d1..c87d789901b1b8d5c93e71008192a8b48f5361d6 100644 (file)
@@ -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`
index 0ff153274410a8fc920158408f6c223ef4532443..57b4a67de367dae64cc7d625f74c207d084ba780 100644 (file)
@@ -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>>>());
     }
 
index bafd5fbe94487784e3219c900acb04b8a496eb16..47b909df5e8da77a402c765d288ac83deb15992b 100644 (file)
@@ -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() {
index dad72fbd0e30b15d488a93646cb1c492da5c5dc0..f6c76f2c7b86b70259739b38c4e981ed4f0957ca 100644 (file)
@@ -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 @@ fn test_to_json() {
 
     #[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;
index 629991799e73de2d4638eb849521244acad18cb5..acf0fe7f6cde36a470e7131ad20d6a35df8f7084 100644 (file)
@@ -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;
index ae3c4addf3883c9c324af0fc583c9c9c25db1ed0..f9a202523b56222e1b7c38bb602b6aecc2e4542d 100644 (file)
@@ -2975,7 +2975,6 @@ mod test {
     use ast_util;
     use codemap;
     use parse::token;
-    use ptr::P;
 
     #[test]
     fn test_fun_to_string() {
index 2e59b15b6d9189d2111becce633b2f63549ee287..0f3d84ae6ea71f4148428cb4194888b4a80bb7d2 100644 (file)
@@ -1118,9 +1118,8 @@ pub fn benchmark<F>(f: F) -> BenchSamples where F: FnMut(&mut Bencher) {
 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;