diff --git a/src/doc/trpl/testing.md b/src/doc/trpl/testing.md index 8fb08e1c6cfde..01dbe540ae8d3 100644 --- a/src/doc/trpl/testing.md +++ b/src/doc/trpl/testing.md @@ -231,7 +231,7 @@ pub fn add_two(a: i32) -> i32 { } #[cfg(test)] -mod tests { +mod test { use super::add_two; #[test] @@ -241,7 +241,7 @@ mod tests { } ``` -There's a few changes here. The first is the introduction of a `mod tests` with +There's a few changes here. The first is the introduction of a `mod test` with a `cfg` attribute. The module allows us to group all of our tests together, and to also define helper functions if needed, that don't become a part of the rest of our crate. The `cfg` attribute only compiles our test code if we're @@ -260,7 +260,7 @@ pub fn add_two(a: i32) -> i32 { } #[cfg(test)] -mod tests { +mod test { use super::*; #[test] @@ -382,7 +382,7 @@ pub fn add_two(a: i32) -> i32 { } #[cfg(test)] -mod tests { +mod test { use super::*; #[test] diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 9b37ddc7ab533..cce5d241fae27 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -648,7 +648,7 @@ impl Hash for Arc { } #[cfg(test)] -mod tests { +mod test { use std::clone::Clone; use std::sync::mpsc::channel; use std::mem::drop; diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 7cdd488842621..670acb2b2e33f 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -816,7 +816,7 @@ impl RcBoxPtr for Weak { } #[cfg(test)] -mod tests { +mod test { use super::{Rc, Weak, weak_count, strong_count}; use std::boxed::Box; use std::cell::RefCell; diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index 7843be0b483eb..7aedb79434f52 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -527,7 +527,7 @@ impl Drop for TypedArena { } #[cfg(test)] -mod tests { +mod test { extern crate test; use self::test::Bencher; use super::{Arena, TypedArena}; diff --git a/src/libcoretest/num/int_macros.rs b/src/libcoretest/num/int_macros.rs index fa41167cae8a6..bcddeca7cbbb4 100644 --- a/src/libcoretest/num/int_macros.rs +++ b/src/libcoretest/num/int_macros.rs @@ -10,7 +10,7 @@ macro_rules! int_module { ($T:ty, $T_i:ident) => ( #[cfg(test)] -mod tests { +mod test { use core::$T_i::*; use core::isize; use core::num::{FromStrRadix, Int, SignedInt}; diff --git a/src/libcoretest/num/uint_macros.rs b/src/libcoretest/num/uint_macros.rs index 39e41a4fad3b7..39aa61c948c4c 100644 --- a/src/libcoretest/num/uint_macros.rs +++ b/src/libcoretest/num/uint_macros.rs @@ -10,7 +10,7 @@ macro_rules! uint_module { ($T:ty, $T_i:ident) => ( #[cfg(test)] -mod tests { +mod test { use core::$T_i::*; use core::num::Int; use num; diff --git a/src/libflate/lib.rs b/src/libflate/lib.rs index 63d1fe968fe1b..1063b5127fcfd 100644 --- a/src/libflate/lib.rs +++ b/src/libflate/lib.rs @@ -152,7 +152,7 @@ pub fn inflate_bytes_zlib(bytes: &[u8]) -> Result { } #[cfg(test)] -mod tests { +mod test { #![allow(deprecated)] use super::{inflate_bytes, deflate_bytes}; use std::rand; diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs index 9b220409ef597..c43569b4d7070 100644 --- a/src/libfmt_macros/lib.rs +++ b/src/libfmt_macros/lib.rs @@ -441,7 +441,7 @@ impl<'a> Parser<'a> { } #[cfg(test)] -mod tests { +mod test { use super::*; fn same(fmt: &'static str, p: &[Piece<'static>]) { diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index 9a5dde8e45e2f..ad7d71d9f4e86 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -971,7 +971,7 @@ fn test_split_within() { } #[cfg(test)] -mod tests { +mod test { use super::*; use super::Fail::*; diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index b3a3f266a5ef3..aa3380ab5ddca 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -591,7 +591,7 @@ pub fn render_opts<'a, N:Clone+'a, E:Clone+'a, G:Labeller<'a,N,E>+GraphWalk<'a,N } #[cfg(test)] -mod tests { +mod test { use self::NodeLabels::*; use super::{Id, Labeller, Nodes, Edges, GraphWalk, render}; use super::LabelText::{self, LabelStr, EscStr}; diff --git a/src/liblog/directive.rs b/src/liblog/directive.rs index 46b9b2ed86539..7f8e148b95300 100644 --- a/src/liblog/directive.rs +++ b/src/liblog/directive.rs @@ -83,7 +83,7 @@ pub fn parse_logging_spec(spec: &str) -> (Vec, Option) { } #[cfg(test)] -mod tests { +mod test { use super::parse_logging_spec; #[test] diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index 1cfac4d86680d..d50854adef85a 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -457,7 +457,7 @@ fn init() { } #[cfg(test)] -mod tests { +mod test { use super::enabled; use directive::LogDirective; diff --git a/src/librand/distributions/mod.rs b/src/librand/distributions/mod.rs index 62189e721e59d..f43bc8ab81a66 100644 --- a/src/librand/distributions/mod.rs +++ b/src/librand/distributions/mod.rs @@ -263,7 +263,7 @@ fn ziggurat( } #[cfg(test)] -mod tests { +mod test { use std::prelude::v1::*; use {Rng, Rand}; diff --git a/src/librand/distributions/normal.rs b/src/librand/distributions/normal.rs index 7cecc6ac611e2..0a94d617621e8 100644 --- a/src/librand/distributions/normal.rs +++ b/src/librand/distributions/normal.rs @@ -161,7 +161,7 @@ impl IndependentSample for LogNormal { } #[cfg(test)] -mod tests { +mod test { use std::prelude::v1::*; use distributions::{Sample, IndependentSample}; diff --git a/src/librand/distributions/range.rs b/src/librand/distributions/range.rs index 347d494259d08..d4e51730cfc0e 100644 --- a/src/librand/distributions/range.rs +++ b/src/librand/distributions/range.rs @@ -164,7 +164,7 @@ float_impl! { f32 } float_impl! { f64 } #[cfg(test)] -mod tests { +mod test { use std::num::Int; use std::prelude::v1::*; use distributions::{Sample, IndependentSample}; diff --git a/src/librand/rand_impls.rs b/src/librand/rand_impls.rs index e2a5276cc78ab..32d7510febb85 100644 --- a/src/librand/rand_impls.rs +++ b/src/librand/rand_impls.rs @@ -213,7 +213,7 @@ impl Rand for Option { } #[cfg(test)] -mod tests { +mod test { use std::rand::{Rng, thread_rng, Open01, Closed01}; struct ConstantRng(u64); diff --git a/src/librustc_back/sha2.rs b/src/librustc_back/sha2.rs index c7049f750fcdb..5ff2fdb1095e0 100644 --- a/src/librustc_back/sha2.rs +++ b/src/librustc_back/sha2.rs @@ -529,7 +529,7 @@ static H256: [u32; 8] = [ ]; #[cfg(test)] -mod tests { +mod test { #![allow(deprecated)] extern crate rand; diff --git a/src/librustc_bitflags/lib.rs b/src/librustc_bitflags/lib.rs index 93a2a5d125778..4d156c5e91d0e 100644 --- a/src/librustc_bitflags/lib.rs +++ b/src/librustc_bitflags/lib.rs @@ -297,7 +297,7 @@ mod core { #[cfg(test)] #[allow(non_upper_case_globals)] -mod tests { +mod test { use std::hash::{self, SipHasher}; use std::option::Option::{Some, None}; diff --git a/src/libserialize/hex.rs b/src/libserialize/hex.rs index dc44536d60cea..502e50e52e480 100644 --- a/src/libserialize/hex.rs +++ b/src/libserialize/hex.rs @@ -150,7 +150,7 @@ impl FromHex for str { } #[cfg(test)] -mod tests { +mod test { extern crate test; use self::test::Bencher; use hex::{FromHex, ToHex}; diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index f6f059f7210ff..875007893a51b 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -2610,7 +2610,7 @@ impl FromStr for Json { } #[cfg(test)] -mod tests { +mod test { extern crate test; use self::Animal::*; use self::DecodeEnum::*; diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index 20ad71a4bf8c8..3b03a3b8eff4a 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -469,7 +469,7 @@ static ASCII_UPPERCASE_MAP: [u8; 256] = [ #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use super::*; use char::from_u32; diff --git a/src/libstd/env.rs b/src/libstd/env.rs index 71f072302fb21..fe2f0ae864235 100644 --- a/src/libstd/env.rs +++ b/src/libstd/env.rs @@ -727,7 +727,7 @@ mod arch { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use super::*; diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index a00f77080252c..84346b629c251 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -460,7 +460,7 @@ impl IntoBytes for Vec { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use super::*; use libc; diff --git a/src/libstd/fs/mod.rs b/src/libstd/fs/mod.rs index a3128ef0f8d95..87a40203a8c1b 100644 --- a/src/libstd/fs/mod.rs +++ b/src/libstd/fs/mod.rs @@ -873,7 +873,7 @@ pub fn set_permissions>(path: P, perm: Permissions) -> io::Result } #[cfg(test)] -mod tests { +mod test { #![allow(deprecated)] //rand use prelude::v1::*; diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 98581fc43f89e..2fcd24d6f1006 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -475,7 +475,7 @@ impl fmt::Debug for BufStream where S: fmt::Debug { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use io::prelude::*; use io::{self, BufReader, BufWriter, BufStream, Cursor, LineWriter}; diff --git a/src/libstd/io/cursor.rs b/src/libstd/io/cursor.rs index 79f0af670b446..032dcf2d86df2 100644 --- a/src/libstd/io/cursor.rs +++ b/src/libstd/io/cursor.rs @@ -163,7 +163,7 @@ impl Write for Cursor> { #[cfg(test)] -mod tests { +mod test { use core::prelude::*; use io::prelude::*; diff --git a/src/libstd/io/impls.rs b/src/libstd/io/impls.rs index ce03e26866b7d..b74fad94acfe5 100644 --- a/src/libstd/io/impls.rs +++ b/src/libstd/io/impls.rs @@ -207,7 +207,7 @@ impl Write for Vec { } #[cfg(test)] -mod tests { +mod test { use io::prelude::*; use vec::Vec; use test; diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 830a88bb6c95b..f53013017bd3f 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -909,7 +909,7 @@ impl Iterator for Lines { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use io::prelude::*; use io; diff --git a/src/libstd/net/addr.rs b/src/libstd/net/addr.rs index a08b33b342bec..50a481683fde4 100644 --- a/src/libstd/net/addr.rs +++ b/src/libstd/net/addr.rs @@ -457,7 +457,7 @@ impl<'a, T: ToSocketAddrs + ?Sized> ToSocketAddrs for &'a T { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use io; use net::*; diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs index 869faa795f9c3..a95ccd6d26e54 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -246,7 +246,7 @@ impl AsInner for TcpListener { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use io::ErrorKind; diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs index 811511149628e..16ec7aa006b32 100644 --- a/src/libstd/net/udp.rs +++ b/src/libstd/net/udp.rs @@ -141,7 +141,7 @@ impl AsInner for UdpSocket { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use io::ErrorKind; diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index dc1d53b8a3963..d276b87b240cd 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -1735,7 +1735,7 @@ pub fn to_str_exp_digits(num: f32, dig: usize, upper: bool) -> String { } #[cfg(test)] -mod tests { +mod test { use f32::*; use num::*; use num::FpCategory as Fp; diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index 41ce9a2598c44..d167de3fc770e 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -1741,7 +1741,7 @@ pub fn to_str_exp_digits(num: f64, dig: usize, upper: bool) -> String { } #[cfg(test)] -mod tests { +mod test { use f64::*; use num::*; use num::FpCategory as Fp; diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index b9e9433e3ee5a..7b76f28e435e6 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -1147,7 +1147,7 @@ pub fn test_num(ten: T, two: T) where } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use super::*; use i8; diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 1c1aaeb6d535a..5dd6ddfe5c46c 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -424,7 +424,7 @@ const DIGIT_P_RADIX: u32 = ('p' as u32) - ('a' as u32) + 11; const DIGIT_E_RADIX: u32 = ('e' as u32) - ('a' as u32) + 11; #[cfg(test)] -mod tests { +mod test { use core::num::wrapping::WrappingOps; use string::ToString; diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs index c9e6a8f66d1d2..5f4990d097969 100644 --- a/src/libstd/num/uint_macros.rs +++ b/src/libstd/num/uint_macros.rs @@ -15,7 +15,7 @@ macro_rules! uint_module { ($T:ty) => ( #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use num::FromStrRadix; diff --git a/src/libstd/old_io/net/pipe.rs b/src/libstd/old_io/net/pipe.rs index 3a071e832af64..1a1e3f48d96a3 100644 --- a/src/libstd/old_io/net/pipe.rs +++ b/src/libstd/old_io/net/pipe.rs @@ -285,7 +285,7 @@ impl sys_common::AsInner for UnixAcceptor { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use old_io::fs::PathExtensions; diff --git a/src/libstd/old_io/process.rs b/src/libstd/old_io/process.rs index 06940bf6860a4..5fa1e254e2554 100644 --- a/src/libstd/old_io/process.rs +++ b/src/libstd/old_io/process.rs @@ -763,7 +763,7 @@ impl Drop for Process { } #[cfg(test)] -mod tests { +mod test { use old_io::{Truncate, Write, TimedOut, timer, process, FileNotFound}; use old_io::{Reader, Writer}; use prelude::v1::{Ok, Err, drop, Some, None, Vec}; diff --git a/src/libstd/old_io/stdio.rs b/src/libstd/old_io/stdio.rs index b4924c7b78b75..d53a02517210b 100644 --- a/src/libstd/old_io/stdio.rs +++ b/src/libstd/old_io/stdio.rs @@ -523,7 +523,7 @@ impl Writer for StdWriter { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use super::*; diff --git a/src/libstd/old_path/posix.rs b/src/libstd/old_path/posix.rs index bbc1756bee632..65daeaae1b2a6 100644 --- a/src/libstd/old_path/posix.rs +++ b/src/libstd/old_path/posix.rs @@ -440,7 +440,7 @@ static dot_static: &'static [u8] = b"."; static dot_dot_static: &'static [u8] = b".."; #[cfg(test)] -mod tests { +mod test { use super::*; use clone::Clone; diff --git a/src/libstd/old_path/windows.rs b/src/libstd/old_path/windows.rs index bd67855bf1b8c..34d9aef3145ae 100644 --- a/src/libstd/old_path/windows.rs +++ b/src/libstd/old_path/windows.rs @@ -1120,7 +1120,7 @@ fn prefix_len(p: Option) -> usize { } #[cfg(test)] -mod tests { +mod test { use super::PathPrefix::*; use super::parse_prefix; use super::*; diff --git a/src/libstd/os.rs b/src/libstd/os.rs index e19c734b8a3ac..2212ac9f05056 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -1504,7 +1504,7 @@ mod arch_consts { } #[cfg(test)] -mod tests { +mod test { #![allow(deprecated)] // rand use prelude::v1::*; diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 58d3ae9f7cfab..66aeb1c725827 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1541,7 +1541,7 @@ impl AsRef for PathBuf { } #[cfg(test)] -mod tests { +mod test { use super::*; use core::prelude::*; use string::{ToString, String}; diff --git a/src/libstd/process.rs b/src/libstd/process.rs index b4bd513e8f027..d19a074896a6e 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -528,7 +528,7 @@ impl Child { } #[cfg(test)] -mod tests { +mod test { use io::ErrorKind; use io::prelude::*; use prelude::v1::{Ok, Err, drop, Some, Vec}; diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs index 428bcaa49f7d9..4797d0b05e84b 100644 --- a/src/libstd/rt/args.rs +++ b/src/libstd/rt/args.rs @@ -106,7 +106,7 @@ mod imp { } #[cfg(test)] - mod tests { + mod test { use prelude::v1::*; use finally::Finally; diff --git a/src/libstd/sync/barrier.rs b/src/libstd/sync/barrier.rs index ebf4d3377499e..8ff58d40514a6 100644 --- a/src/libstd/sync/barrier.rs +++ b/src/libstd/sync/barrier.rs @@ -106,7 +106,7 @@ impl BarrierWaitResult { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use sync::{Arc, Barrier}; diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index 69c5267ab69fc..0848b7ddc06a5 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -341,7 +341,7 @@ impl StaticCondvar { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use super::{StaticCondvar, CONDVAR_INIT}; diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs index 1be8b0dd8628a..fe9348fdcb5bc 100644 --- a/src/libstd/sync/mpsc/mpsc_queue.rs +++ b/src/libstd/sync/mpsc/mpsc_queue.rs @@ -154,7 +154,7 @@ impl Drop for Queue { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use sync::mpsc::channel; diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index a79ffaa0860e3..3e8713c079aad 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -405,7 +405,7 @@ impl<'a, T> Drop for RwLockWriteGuard<'a, T> { } #[cfg(test)] -mod tests { +mod test { #![allow(deprecated)] // rand use prelude::v1::*; diff --git a/src/libstd/sync/semaphore.rs b/src/libstd/sync/semaphore.rs index be521095aa95f..2395b592d7ef8 100644 --- a/src/libstd/sync/semaphore.rs +++ b/src/libstd/sync/semaphore.rs @@ -109,7 +109,7 @@ impl<'a> Drop for SemaphoreGuard<'a> { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use sync::Arc; diff --git a/src/libstd/sys/common/thread_local.rs b/src/libstd/sys/common/thread_local.rs index 5995d7ac10f73..70fced11d4c05 100644 --- a/src/libstd/sys/common/thread_local.rs +++ b/src/libstd/sys/common/thread_local.rs @@ -243,7 +243,7 @@ impl Drop for Key { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use super::{Key, StaticKey, INIT_INNER}; diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index 315df411179f9..bd69d0d570d82 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -843,7 +843,7 @@ impl AsciiExt for Wtf8 { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use borrow::Cow; use super::*; diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 2569653811f11..104a6050b5f70 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -374,7 +374,7 @@ pub fn utime(p: &Path, atime: u64, mtime: u64) -> IoResult<()> { } #[cfg(test)] -mod tests { +mod test { use super::FileDesc; use libc; use os; diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index 297f6e173abdc..4a5b0941de7a8 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -473,7 +473,7 @@ fn free_handle(handle: *mut ()) { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use str; use ffi::CString; diff --git a/src/libstd/sys/windows/process2.rs b/src/libstd/sys/windows/process2.rs index 9e9bb86446e7c..1280b04f7cb5b 100644 --- a/src/libstd/sys/windows/process2.rs +++ b/src/libstd/sys/windows/process2.rs @@ -434,7 +434,7 @@ fn with_dirp(d: Option<&OsString>, cb: F) -> T where } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use str; use ffi::{OsStr, OsString}; diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs index a2b824bb016ff..3d9110a16273b 100644 --- a/src/libstd/thread/local.rs +++ b/src/libstd/thread/local.rs @@ -520,7 +520,7 @@ mod imp { } #[cfg(test)] -mod tests { +mod test { use prelude::v1::*; use sync::mpsc::{channel, Sender}; diff --git a/src/libstd/thread/scoped.rs b/src/libstd/thread/scoped.rs index b384879d7a956..d554200476d79 100644 --- a/src/libstd/thread/scoped.rs +++ b/src/libstd/thread/scoped.rs @@ -275,7 +275,7 @@ mod imp { #[cfg(test)] -mod tests { +mod test { use cell::Cell; use prelude::v1::*; diff --git a/src/libstd/time/duration.rs b/src/libstd/time/duration.rs index 958417d864c1f..6ebe807b01723 100644 --- a/src/libstd/time/duration.rs +++ b/src/libstd/time/duration.rs @@ -427,7 +427,7 @@ fn div_rem_64(this: i64, other: i64) -> (i64, i64) { } #[cfg(test)] -mod tests { +mod test { use super::{Duration, MIN, MAX}; use {i32, i64}; use option::Option::{Some, None}; diff --git a/src/libsyntax/ext/mtwt.rs b/src/libsyntax/ext/mtwt.rs index a2023d6832efb..d74a2acea1a59 100644 --- a/src/libsyntax/ext/mtwt.rs +++ b/src/libsyntax/ext/mtwt.rs @@ -274,7 +274,7 @@ fn xor_push(marks: &mut Vec, mark: Mrk) { } #[cfg(test)] -mod tests { +mod test { use self::TestSC::*; use ast::{EMPTY_CTXT, Ident, Mrk, Name, SyntaxContext}; use super::{resolve, xor_push, apply_mark_internal, new_sctable_internal}; diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index 7ae9e4646e516..834344167e473 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -229,7 +229,7 @@ impl StrInterner { } #[cfg(test)] -mod tests { +mod test { use super::*; use ast::Name; diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs index e20e6d4f29bfa..7bbd593e9416b 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -330,7 +330,7 @@ pub fn winsorize(samples: &mut [T], pct: T) { // Test vectors generated from R, using the script src/etc/stat-test-vectors.r. #[cfg(test)] -mod tests { +mod test { use stats::Stats; use stats::Summary; use std::old_io::{self, Writer}; diff --git a/src/test/run-pass/privacy1.rs b/src/test/run-pass/privacy1.rs index 329c4aaa873a9..361d51c599da3 100644 --- a/src/test/run-pass/privacy1.rs +++ b/src/test/run-pass/privacy1.rs @@ -18,7 +18,7 @@ pub mod test2 { trait A { fn foo(&self) {} } impl A for B {} - mod tests { + mod test { use super::A; fn foo() { let a = super::B;