]> git.lizzy.rs Git - rust.git/commitdiff
fix various warnings
authorErick Tryzelaar <erick.tryzelaar@gmail.com>
Fri, 30 Aug 2013 22:06:11 +0000 (15:06 -0700)
committerErick Tryzelaar <erick.tryzelaar@gmail.com>
Fri, 30 Aug 2013 22:10:55 +0000 (15:10 -0700)
13 files changed:
src/libstd/fmt/parse.rs
src/libstd/ptr.rs
src/libsyntax/parse/mod.rs
src/test/bench/shootout-pfib.rs
src/test/run-pass/const-cross-crate-extern.rs
src/test/run-pass/const-extern-function.rs
src/test/run-pass/extern-compare-with-return-type.rs
src/test/run-pass/extern-take-value.rs
src/test/run-pass/issue-5917.rs
src/test/run-pass/monad.rs
src/test/run-pass/reflect-visit-data.rs
src/test/run-pass/static-impl.rs
src/test/run-pass/trait-generic.rs

index 6448896a489419c4ac601e6a9b3529c88feabaad..4bfa6b5afce3ec1fcdc41b41b930bef06ea2d46e 100644 (file)
@@ -595,7 +595,6 @@ fn integer(&mut self) -> Option<uint> {
 mod tests {
     use super::*;
     use prelude::*;
-    use realstd::fmt::{String};
 
     fn same(fmt: &'static str, p: ~[Piece<'static>]) {
         let mut parser = Parser::new(fmt);
index 02469527b7af66a741181950c9e85c7ab0ec4ec6..38d8a244895e83cc2f8ab32edd4e46c1c7024726 100644 (file)
@@ -12,6 +12,7 @@
 
 use cast;
 use clone::Clone;
+#[cfg(not(test))]
 use cmp::Equiv;
 use iterator::{range, Iterator};
 use option::{Option, Some, None};
index 81113f2432923c6089cf37e932a07806c2a821c8..61dcc6c194782926f1cc80982c667adf15e69e33 100644 (file)
@@ -340,7 +340,7 @@ mod test {
     use parse::token::{str_to_ident};
     use util::parser_testing::{string_to_tts_and_sess, string_to_parser};
     use util::parser_testing::{string_to_expr, string_to_item};
-    use util::parser_testing::{string_to_stmt, strs_to_idents};
+    use util::parser_testing::string_to_stmt;
 
     // map a string to tts, return the tt without its parsesess
     fn string_to_tts_only(source_str : @str) -> ~[ast::token_tree] {
index b2491e305b254a6c3bf1d93a69228759ec9355f0..7029ca2a49296969920d7cb804a0a077e93971a2 100644 (file)
@@ -28,7 +28,6 @@
 use std::os;
 use std::result::{Ok, Err};
 use std::task;
-use std::u64;
 use std::uint;
 
 fn fib(n: int) -> int {
index eb7ae3d6fec99bdedf2736df02c3a696e3d61192..5ded736ab9b0472f6869e863add80fd53e505e2a 100644 (file)
 
 extern mod cci_const;
 use cci_const::bar;
-use std::cast::transmute;
 static foo: extern "C" fn() = bar;
 
 pub fn main() {
-    unsafe {
-        assert_eq!(foo, bar);
-    }
+    assert_eq!(foo, bar);
 }
index e07af4b0383fd1375f0eb2a8db4be96521e4e5ae..501a87955da5731b00a7e3df593cbe397f7ca277 100644 (file)
@@ -18,8 +18,6 @@ struct S {
 }
 
 pub fn main() {
-    unsafe {
-        assert_eq!(foopy, f);
-        assert_eq!(f, s.f);
-    }
+    assert_eq!(foopy, f);
+    assert_eq!(f, s.f);
 }
index 41bf4a10b5d9e74c19e82a5c31e1aaeb416abf23..5406fa283e7e76740a5169999113ba8ab01228b9 100644 (file)
@@ -15,7 +15,7 @@
 
 extern fn uintret() -> uint { 22 }
 
-extern fn uintvoidret(x: uint) {}
+extern fn uintvoidret(_x: uint) {}
 
 extern fn uintuintuintuintret(x: uint, y: uint, z: uint) -> uint { x+y+z }
 
index e636f511da8d309620b59c4c114a475e2bfa682d..b883fbd6f6a04caa4573c8ed1e9ee7cfcac123bb 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::cast::transmute;
-
 extern fn f() {
 }
 
 }
 
 pub fn main() {
-    unsafe {
-        let a: extern "C" fn() = f;
-        let b: extern "C" fn() = f;
-        let c: extern "C" fn() = g;
+    let a: extern "C" fn() = f;
+    let b: extern "C" fn() = f;
+    let c: extern "C" fn() = g;
 
-        assert_eq!(a, b);
-        assert!(a != c);
-    }
+    assert_eq!(a, b);
+    assert!(a != c);
 }
index 3e588bb53d2a6e53b7992d5bf9f3ca68d49584a1..326e92d3b70857ffc13e047fd223f2d69b4a5112 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::io;
-
 struct T (&'static [int]);
 static t : T = T (&'static [5, 4, 3]);
 fn main () {
index 7dc859e559efa53a9e2868bdb141d3f7caf63669..8baf15c8493be409930dc1d19c5622cde63a76b2 100644 (file)
@@ -10,8 +10,6 @@
 
 // xfail-fast
 
-use std::int;
-
 trait vec_monad<A> {
     fn bind<B>(&self, f: &fn(&A) -> ~[B]) -> ~[B];
 }
index efa3286e94a19b0634700cab9f224a3a8c3913db..1c77a6b2fb95796e7ed8d84f28ec148076fcedf3 100644 (file)
@@ -10,7 +10,6 @@
 
 // xfail-fast
 
-use std::int;
 use std::libc::c_void;
 use std::ptr;
 use std::sys;
index 520b3583195ae75b6548e3b7f96634be6186380c..651b3342d5833e3f612c1f62384b9fab8d65c76f 100644 (file)
@@ -10,8 +10,6 @@
 
 // xfail-fast
 
-use std::uint;
-
 pub trait plus {
     fn plus(&self) -> int;
 }
index 6916db28e11ea611b08b7b99aef3ed7589ce3ab8..f448bcb4ab5d27fda032df640a84f5ae4f3ff2b3 100644 (file)
@@ -10,8 +10,6 @@
 
 // xfail-fast
 
-use std::int;
-
 trait to_str {
     fn to_string(&self) -> ~str;
 }