about summary refs log tree commit diff
path: root/src/libcoretest
diff options
context:
space:
mode:
authorNODA, Kai <nodakai@gmail.com>2014-10-05 18:11:17 +0800
committerNODA, Kai <nodakai@gmail.com>2014-10-13 14:16:22 +0800
commitf27ad3d3e99ce679f782607971a9f6f18befa503 (patch)
tree388f850cfb1e4d06077dfa6cd28a0e79eda28c07 /src/libcoretest
parenta6e0c76ef4b8ed87698dc9fe51e952039d33b913 (diff)
downloadrust-f27ad3d3e99ce679f782607971a9f6f18befa503.tar.gz
rust-f27ad3d3e99ce679f782607971a9f6f18befa503.zip
Clean up rustc warnings.
compiletest: compact "linux" "macos" etc.as "unix".
liballoc: remove a superfluous "use".
libcollections: remove invocations of deprecated methods in favor of
    their suggested replacements and use "_" for a loop counter.
libcoretest: remove invocations of deprecated methods;  also add
    "allow(deprecated)" for testing a deprecated method itself.
libglob: use "cfg_attr".
libgraphviz: add a test for one of data constructors.
libgreen: remove a superfluous "use".
libnum: "allow(type_overflow)" for type cast into u8 in a test code.
librustc: names of static variables should be in upper case.
libserialize: v[i] instead of get().
libstd/ascii: to_lowercase() instead of to_lower().
libstd/bitflags: modify AnotherSetOfFlags to use i8 as its backend.
    It will serve better for testing various aspects of bitflags!.
libstd/collections: "allow(deprecated)" for testing a deprecated
    method itself.
libstd/io: remove invocations of deprecated methods and superfluous "use".
    Also add #[test] where it was missing.
libstd/num: introduce a helper function to effectively remove
    invocations of a deprecated method.
libstd/path and rand: remove invocations of deprecated methods and
    superfluous "use".
libstd/task and libsync/comm: "allow(deprecated)" for testing
    a deprecated method itself.
libsync/deque: remove superfluous "unsafe".
libsync/mutex and once: names of static variables should be in upper case.
libterm: introduce a helper function to effectively remove
    invocations of a deprecated method.

We still see a few warnings about using obsoleted native::task::spawn()
in the test modules for libsync.  I'm not sure how I should replace them
with std::task::TaksBuilder and native::task::NativeTaskBuilder
(dependency to libstd?)

Signed-off-by: NODA, Kai <nodakai@gmail.com>
Diffstat (limited to 'src/libcoretest')
-rw-r--r--src/libcoretest/char.rs4
-rw-r--r--src/libcoretest/iter.rs2
-rw-r--r--src/libcoretest/mem.rs2
-rw-r--r--src/libcoretest/result.rs1
4 files changed, 5 insertions, 4 deletions
diff --git a/src/libcoretest/char.rs b/src/libcoretest/char.rs
index 9628d7950b5..8807756d01b 100644
--- a/src/libcoretest/char.rs
+++ b/src/libcoretest/char.rs
@@ -117,7 +117,7 @@ fn test_is_digit() {
 fn test_escape_default() {
     fn string(c: char) -> String {
         let mut result = String::new();
-        escape_default(c, |c| { result.push_char(c); });
+        escape_default(c, |c| { result.push(c); });
         return result;
     }
     let s = string('\n');
@@ -152,7 +152,7 @@ fn test_escape_default() {
 fn test_escape_unicode() {
     fn string(c: char) -> String {
         let mut result = String::new();
-        escape_unicode(c, |c| { result.push_char(c); });
+        escape_unicode(c, |c| { result.push(c); });
         return result;
     }
     let s = string('\x00');
diff --git a/src/libcoretest/iter.rs b/src/libcoretest/iter.rs
index 4135a02cc61..476a2b50fcc 100644
--- a/src/libcoretest/iter.rs
+++ b/src/libcoretest/iter.rs
@@ -868,7 +868,7 @@ fn bench_multiple_take(b: &mut Bencher) {
     let mut it = range(0u, 42).cycle();
     b.iter(|| {
         let n = it.next().unwrap();
-        for m in range(0u, n) {
+        for _ in range(0u, n) {
             it.take(it.next().unwrap()).all(|_| true);
         }
     });
diff --git a/src/libcoretest/mem.rs b/src/libcoretest/mem.rs
index 76409c8612f..e4dde7c641e 100644
--- a/src/libcoretest/mem.rs
+++ b/src/libcoretest/mem.rs
@@ -109,7 +109,7 @@ fn test_transmute() {
     }
 
     unsafe {
-        assert!(Vec::from_slice([76u8]) == transmute("L".to_string()));
+        assert!(vec![76u8] == transmute("L".to_string()));
     }
 }
 
diff --git a/src/libcoretest/result.rs b/src/libcoretest/result.rs
index b45ac6a993e..b023833f394 100644
--- a/src/libcoretest/result.rs
+++ b/src/libcoretest/result.rs
@@ -89,6 +89,7 @@ fn test_collect() {
 }
 
 #[test]
+#[allow(deprecated)] // we know fold_ is deprecated
 fn test_fold() {
     assert_eq!(fold_(range(0i, 0)
                     .map(|_| Ok::<(), ()>(()))),