diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-05-24 19:35:29 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-05-29 19:04:53 -0700 |
| commit | 206ab89629298cc9f4b6fb0aa1cd7556c65b5bfe (patch) | |
| tree | 6a899250550f71bf26f5d57e3cbeee8b97661c9f /src/test | |
| parent | 4e3d4b36dc3a030bb5f152afbfccfd4427830dac (diff) | |
librustc: Stop reexporting the standard modules from prelude.
Diffstat (limited to 'src/test')
396 files changed, 939 insertions, 218 deletions
diff --git a/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs b/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs index bccbb8173aa..77f257ea4f5 100644 --- a/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs +++ b/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs @@ -14,6 +14,10 @@ vers = "0.1")]; #[crate_type = "lib"]; + +use std::libc; + extern { - fn rust_get_argc() -> libc::c_int; + pub fn rust_get_argc() -> libc::c_int; } + diff --git a/src/test/auxiliary/cci_capture_clause.rs b/src/test/auxiliary/cci_capture_clause.rs index 13cc27e0e27..e58b28aa3de 100644 --- a/src/test/auxiliary/cci_capture_clause.rs +++ b/src/test/auxiliary/cci_capture_clause.rs @@ -9,6 +9,7 @@ // except according to those terms. use std::comm::*; +use std::task; pub fn foo<T:Owned + Copy>(x: T) -> Port<T> { let (p, c) = stream(); diff --git a/src/test/auxiliary/cci_class_5.rs b/src/test/auxiliary/cci_class_5.rs index c04cdbcab1a..10dedc12399 100644 --- a/src/test/auxiliary/cci_class_5.rs +++ b/src/test/auxiliary/cci_class_5.rs @@ -9,6 +9,8 @@ // except according to those terms. pub mod kitties { + use std::uint; + pub struct cat { priv meows : uint, how_hungry : int, diff --git a/src/test/auxiliary/explicit_self_xcrate.rs b/src/test/auxiliary/explicit_self_xcrate.rs index 058cb53f918..be65cadcc7f 100644 --- a/src/test/auxiliary/explicit_self_xcrate.rs +++ b/src/test/auxiliary/explicit_self_xcrate.rs @@ -20,6 +20,6 @@ pub struct Bar { impl Foo for Bar { #[inline(always)] fn f(&self) { - io::println((*self).x); + println((*self).x); } } diff --git a/src/test/auxiliary/extern-crosscrate-source.rs b/src/test/auxiliary/extern-crosscrate-source.rs index 3c81c787a09..ba9091ce0e5 100644 --- a/src/test/auxiliary/extern-crosscrate-source.rs +++ b/src/test/auxiliary/extern-crosscrate-source.rs @@ -13,7 +13,11 @@ #[crate_type = "lib"]; +use std::libc; + pub mod rustrt { + use std::libc; + pub extern { pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; diff --git a/src/test/auxiliary/foreign_lib.rs b/src/test/auxiliary/foreign_lib.rs index fe5b9e45593..f8b2c2f458a 100644 --- a/src/test/auxiliary/foreign_lib.rs +++ b/src/test/auxiliary/foreign_lib.rs @@ -11,6 +11,8 @@ #[link(name="foreign_lib", vers="0.0")]; pub mod rustrt { + use std::libc; + pub extern { pub fn rust_get_argc() -> libc::c_int; } diff --git a/src/test/auxiliary/issue-3012-1.rs b/src/test/auxiliary/issue-3012-1.rs index 36343d42b75..ce40afff3ae 100644 --- a/src/test/auxiliary/issue-3012-1.rs +++ b/src/test/auxiliary/issue-3012-1.rs @@ -12,6 +12,8 @@ #[crate_type = "lib"]; pub mod socket { + use std::libc; + pub struct socket_handle { sockfd: libc::c_int, } diff --git a/src/test/auxiliary/moves_based_on_type_lib.rs b/src/test/auxiliary/moves_based_on_type_lib.rs index 857593a84d2..b3a9b3e1ee9 100644 --- a/src/test/auxiliary/moves_based_on_type_lib.rs +++ b/src/test/auxiliary/moves_based_on_type_lib.rs @@ -16,7 +16,7 @@ pub struct S { impl Drop for S { fn finalize(&self) { - io::println("goodbye"); + println("goodbye"); } } diff --git a/src/test/auxiliary/static-methods-crate.rs b/src/test/auxiliary/static-methods-crate.rs index 2ecd318db3c..b5b33853129 100644 --- a/src/test/auxiliary/static-methods-crate.rs +++ b/src/test/auxiliary/static-methods-crate.rs @@ -13,6 +13,8 @@ #[crate_type = "lib"]; +use std::int; + pub trait read { fn readMaybe(s: ~str) -> Option<Self>; } diff --git a/src/test/bench/core-map.rs b/src/test/bench/core-map.rs index 7904041ea3c..fd1110abb22 100644 --- a/src/test/bench/core-map.rs +++ b/src/test/bench/core-map.rs @@ -10,12 +10,15 @@ extern mod extra; -use std::io; use extra::time; use extra::treemap::TreeMap; use std::hashmap::{HashMap, HashSet}; -use std::trie::TrieMap; +use std::io; +use std::os; use std::rand::Rng; +use std::trie::TrieMap; +use std::uint; +use std::vec; fn timed(label: &str, f: &fn()) { let start = time::precise_time_s(); diff --git a/src/test/bench/core-set.rs b/src/test/bench/core-set.rs index 86215e609ee..5281c1b863c 100644 --- a/src/test/bench/core-set.rs +++ b/src/test/bench/core-set.rs @@ -9,9 +9,14 @@ // except according to those terms. extern mod extra; -use std::hashmap::HashSet; + use extra::bitv::BitvSet; use extra::treemap::TreeSet; +use std::hashmap::HashSet; +use std::io; +use std::os; +use std::rand; +use std::uint; struct Results { sequential_ints: float, diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index 024d4a02897..287daf68eff 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -13,8 +13,15 @@ extern mod extra; use extra::time::precise_time_s; +use std::int; +use std::io; +use std::os; use std::rand::RngUtil; +use std::rand; +use std::result; +use std::uint; use std::util; +use std::vec; macro_rules! bench ( ($id:ident) => (maybe_run_test(argv, stringify!($id).to_owned(), $id)) diff --git a/src/test/bench/core-uint-to-str.rs b/src/test/bench/core-uint-to-str.rs index c637fcbaf50..cbf73d5c059 100644 --- a/src/test/bench/core-uint-to-str.rs +++ b/src/test/bench/core-uint-to-str.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::os; +use std::uint; + fn main() { let args = os::args(); let args = if os::getenv(~"RUST_BENCH").is_some() { diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs index 06c8d0c145b..38cc3127343 100644 --- a/src/test/bench/graph500-bfs.rs +++ b/src/test/bench/graph500-bfs.rs @@ -23,7 +23,12 @@ use extra::deque::Deque; use extra::par; use std::hashmap::HashSet; use std::int::abs; +use std::io; +use std::os; use std::rand::RngUtil; +use std::rand; +use std::uint; +use std::vec; type node_id = i64; type graph = ~[~[node_id]]; diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs index e041f607057..9fbc1d4590d 100644 --- a/src/test/bench/msgsend-pipes-shared.rs +++ b/src/test/bench/msgsend-pipes-shared.rs @@ -19,10 +19,16 @@ // version. extern mod extra; -use std::io::Writer; -use std::io::WriterUtil; use std::comm::{Port, Chan, SharedChan}; +use std::comm; +use std::io::{Writer, WriterUtil}; +use std::io; +use std::os; +use std::task; +use std::ptr; +use std::uint; +use std::vec; macro_rules! move_out ( { $x:expr } => { unsafe { let y = *ptr::to_unsafe_ptr(&($x)); y } } diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs index a854de0a828..2663bb26670 100644 --- a/src/test/bench/msgsend-pipes.rs +++ b/src/test/bench/msgsend-pipes.rs @@ -15,10 +15,15 @@ // I *think* it's the same, more or less. extern mod extra; -use std::io::Writer; -use std::io::WriterUtil; use std::comm::{Port, PortSet, Chan, stream}; +use std::io::{Writer, WriterUtil}; +use std::io; +use std::os; +use std::ptr; +use std::task; +use std::uint; +use std::vec; macro_rules! move_out ( { $x:expr } => { unsafe { let y = *ptr::to_unsafe_ptr(&($x)); y } } diff --git a/src/test/bench/msgsend-ring-mutex-arcs.rs b/src/test/bench/msgsend-ring-mutex-arcs.rs index ffca59e3e8f..3d3a6a68beb 100644 --- a/src/test/bench/msgsend-ring-mutex-arcs.rs +++ b/src/test/bench/msgsend-ring-mutex-arcs.rs @@ -16,26 +16,35 @@ // This also serves as a pipes test, because ARCs are implemented with pipes. extern mod extra; -use extra::time; + use extra::arc; use extra::future; +use extra::time; use std::cell::Cell; +use std::io; +use std::os; +use std::uint; +use std::vec; // A poor man's pipe. type pipe = arc::MutexARC<~[uint]>; fn send(p: &pipe, msg: uint) { - do p.access_cond |state, cond| { - state.push(msg); - cond.signal(); + unsafe { + do p.access_cond |state, cond| { + state.push(msg); + cond.signal(); + } } } fn recv(p: &pipe) -> uint { - do p.access_cond |state, cond| { - while vec::is_empty(*state) { - cond.wait(); + unsafe { + do p.access_cond |state, cond| { + while vec::is_empty(*state) { + cond.wait(); + } + state.pop() } - state.pop() } } diff --git a/src/test/bench/msgsend-ring-pipes.rs b/src/test/bench/msgsend-ring-pipes.rs index 7b6e94fa10b..21753f5f331 100644 --- a/src/test/bench/msgsend-ring-pipes.rs +++ b/src/test/bench/msgsend-ring-pipes.rs @@ -18,11 +18,15 @@ extern mod extra; +use extra::future; +use extra::time; use std::cell::Cell; +use std::io; +use std::os; use std::pipes::recv; +use std::ptr; +use std::uint; use std::util; -use extra::time; -use extra::future; proto! ring ( num:send { diff --git a/src/test/bench/msgsend-ring-rw-arcs.rs b/src/test/bench/msgsend-ring-rw-arcs.rs index 78f7c02a40b..46ca59f2d31 100644 --- a/src/test/bench/msgsend-ring-rw-arcs.rs +++ b/src/test/bench/msgsend-ring-rw-arcs.rs @@ -17,10 +17,14 @@ extern mod extra; -use std::cell::Cell; -use extra::time; use extra::arc; use extra::future; +use extra::time; +use std::cell::Cell; +use std::io; +use std::os; +use std::uint; +use std::vec; // A poor man's pipe. type pipe = arc::RWARC<~[uint]>; diff --git a/src/test/bench/noise.rs b/src/test/bench/noise.rs index cf1eae3d37b..8f39ae62f9e 100644 --- a/src/test/bench/noise.rs +++ b/src/test/bench/noise.rs @@ -1,6 +1,10 @@ // Perlin noise benchmark from https://gist.github.com/1170424 +use std::f32; +use std::float; +use std::int; use std::rand::{Rng, RngUtil}; +use std::rand; struct Vec2 { x: f32, diff --git a/src/test/bench/pingpong.rs b/src/test/bench/pingpong.rs index 970a970feb1..382de68ba57 100644 --- a/src/test/bench/pingpong.rs +++ b/src/test/bench/pingpong.rs @@ -14,9 +14,12 @@ extern mod extra; +use extra::time::precise_time_s; use std::cell::Cell; +use std::io; +use std::os; use std::pipes::*; -use extra::time::precise_time_s; +use std::task; proto! pingpong ( ping: send { diff --git a/src/test/bench/shootout-ackermann.rs b/src/test/bench/shootout-ackermann.rs index 4a811305679..51fec4dbfe8 100644 --- a/src/test/bench/shootout-ackermann.rs +++ b/src/test/bench/shootout-ackermann.rs @@ -10,6 +10,10 @@ extern mod extra; +use std::int; +use std::io; +use std::os; + fn ack(m: int, n: int) -> int { if m == 0 { return n + 1 diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index 0ccb9a16ada..58b8a9cd47b 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -11,9 +11,16 @@ // chameneos extern mod extra; + use extra::sort; use std::cell::Cell; use std::comm::*; +use std::io; +use std::option; +use std::os; +use std::task; +use std::uint; +use std::vec; fn print_complements() { let all = ~[Blue, Red, Yellow]; diff --git a/src/test/bench/shootout-fannkuch-redux.rs b/src/test/bench/shootout-fannkuch-redux.rs index a65bfe228b2..1dd346a2813 100644 --- a/src/test/bench/shootout-fannkuch-redux.rs +++ b/src/test/bench/shootout-fannkuch-redux.rs @@ -1,6 +1,8 @@ use std::from_str::FromStr; use std::i32::range; +use std::os; use std::vec::MutableVector; +use std::vec; fn max(a: i32, b: i32) -> i32 { if a > b { diff --git a/src/test/bench/shootout-fasta-redux.rs b/src/test/bench/shootout-fasta-redux.rs index 840f6fdb17b..9ea58d9970d 100644 --- a/src/test/bench/shootout-fasta-redux.rs +++ b/src/test/bench/shootout-fasta-redux.rs @@ -1,8 +1,11 @@ use std::cast::transmute; use std::from_str::FromStr; use std::libc::{FILE, STDOUT_FILENO, c_int, fdopen, fputc, fputs, fwrite, size_t}; +use std::os; +use std::str; use std::uint::{min, range}; use std::vec::bytes::copy_memory; +use std::vec; static LINE_LEN: uint = 60; static LOOKUP_SIZE: uint = 4 * 1024; diff --git a/src/test/bench/shootout-fasta.rs b/src/test/bench/shootout-fasta.rs index f3de8bf01e9..78a37f06bb9 100644 --- a/src/test/bench/shootout-fasta.rs +++ b/src/test/bench/shootout-fasta.rs @@ -16,7 +16,17 @@ * http://shootout.alioth.debian.org/ */ extern mod extra; + +use std::int; +use std::io; +use std::option; +use std::os; use std::rand::Rng; +use std::rand; +use std::result; +use std::str; +use std::uint; +use std::vec; fn LINE_LENGTH() -> uint { return 60u; } diff --git a/src/test/bench/shootout-fibo.rs b/src/test/bench/shootout-fibo.rs index cfb8e0fe7c9..a1bb0e9e6d8 100644 --- a/src/test/bench/shootout-fibo.rs +++ b/src/test/bench/shootout-fibo.rs @@ -10,6 +10,10 @@ extern mod extra; +use std::int; +use std::io; +use std::os; + fn fib(n: int) -> int { if n < 2 { return 1; diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index e0ffd3e4133..e403ba6e73d 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -12,12 +12,21 @@ // multi tasking k-nucleotide extern mod extra; + use extra::sort; +use std::cmp::Ord; +use std::comm::{stream, Port, Chan}; +use std::comm; use std::hashmap::HashMap; use std::io::ReaderUtil; -use std::comm::{stream, Port, Chan}; -use std::cmp::Ord; +use std::io; +use std::option; +use std::os; +use std::result; +use std::str; +use std::task; use std::util; +use std::vec; // given a map, print a sorted version of it fn sort_and_fmt(mm: &HashMap<~[u8], uint>, total: uint) -> ~str { diff --git a/src/test/bench/shootout-mandelbrot.rs b/src/test/bench/shootout-mandelbrot.rs index d4c3862fd7e..69eff07093b 100644 --- a/src/test/bench/shootout-mandelbrot.rs +++ b/src/test/bench/shootout-mandelbrot.rs @@ -2,6 +2,7 @@ use std::cast::transmute; use std::from_str::FromStr; use std::i32::range; use std::libc::{STDOUT_FILENO, c_int, fdopen, fputc}; +use std::os; static ITER: uint = 50; static LIMIT: f64 = 2.0; diff --git a/src/test/bench/shootout-nbody.rs b/src/test/bench/shootout-nbody.rs index a226d50dc27..744e3041c8f 100644 --- a/src/test/bench/shootout-nbody.rs +++ b/src/test/bench/shootout-nbody.rs @@ -1,5 +1,8 @@ +use std::f64; use std::from_str::FromStr; +use std::os; use std::uint::range; +use std::vec; static PI: f64 = 3.141592653589793; static SOLAR_MASS: f64 = 4.0 * PI * PI; diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs index e201438a6ef..0a093d87a15 100644 --- a/src/test/bench/shootout-pfib.rs +++ b/src/test/bench/shootout-pfib.rs @@ -22,11 +22,17 @@ extern mod extra; use extra::{time, getopts}; -use std::int::range; use std::comm::*; +use std::int::range; use std::io::WriterUtil; - +use std::io; +use std::os; use std::result::{Ok, Err}; +use std::str; +use std::task; +use std::u64; +use std::uint; +use std::vec; fn fib(n: int) -> int { fn pfib(c: &Chan<int>, n: int) { diff --git a/src/test/bench/shootout-spectralnorm.rs b/src/test/bench/shootout-spectralnorm.rs index a3beee7c90d..77aaa2782d8 100644 --- a/src/test/bench/shootout-spectralnorm.rs +++ b/src/test/bench/shootout-spectralnorm.rs @@ -1,5 +1,8 @@ +use std::f64; use std::from_str::FromStr; use std::iter::ExtendedMutableIter; +use std::os; +use std::vec; #[inline] fn A(i: i32, j: i32) -> i32 { diff --git a/src/test/bench/std-smallintmap.rs b/src/test/bench/std-smallintmap.rs index f1cd05e1d9e..23ac68315e3 100644 --- a/src/test/bench/std-smallintmap.rs +++ b/src/test/bench/std-smallintmap.rs @@ -11,8 +11,12 @@ // Microbenchmark for the smallintmap library extern mod extra; + use extra::smallintmap::SmallIntMap; use std::io::WriterUtil; +use std::io; +use std::os; +use std::uint; fn append_sequential(min: uint, max: uint, map: &mut SmallIntMap<uint>) { for uint::range(min, max) |i| { diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index e3f02684bb0..dbce9d60af7 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -14,7 +14,12 @@ extern mod extra; use std::io::{ReaderUtil, WriterUtil}; use std::io; +use std::os; +use std::str; +use std::u8; +use std::uint; use std::unstable::intrinsics::cttz16; +use std::vec; // Computes a single solution to a given 9x9 sudoku // @@ -167,10 +172,10 @@ impl Colors { let val = **self & heads; if (0u16 == val) { return 0u8; - } - else - { - return cttz16(val as i16) as u8; + } else { + unsafe { + return cttz16(val as i16) as u8; + } } } diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index a6d94c75354..a0363bd568a 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -14,6 +14,8 @@ extern mod extra; use extra::list::{List, Cons, Nil}; use extra::time::precise_time_s; +use std::os; +use std::task; enum UniqueList { ULNil, ULCons(~UniqueList) diff --git a/src/test/bench/task-perf-jargon-metal-smoke.rs b/src/test/bench/task-perf-jargon-metal-smoke.rs index 4600cf46892..78923c8cc96 100644 --- a/src/test/bench/task-perf-jargon-metal-smoke.rs +++ b/src/test/bench/task-perf-jargon-metal-smoke.rs @@ -18,6 +18,10 @@ // The filename is a song reference; google it in quotes. use std::cell::Cell; +use std::comm; +use std::os; +use std::task; +use std::uint; fn child_generation(gens_left: uint, c: comm::Chan<()>) { // This used to be O(n^2) in the number of generations that ever existed. diff --git a/src/test/bench/task-perf-linked-failure.rs b/src/test/bench/task-perf-linked-failure.rs index b8cba98c6fb..514b85c6ae0 100644 --- a/src/test/bench/task-perf-linked-failure.rs +++ b/src/test/bench/task-perf-linked-failure.rs @@ -23,6 +23,10 @@ // Doesn't return until all such tasks are ready, but doesn't block forever itself. use std::comm::*; +use std::os; +use std::result; +use std::task; +use std::uint; fn grandchild_group(num_tasks: uint) { let (po, ch) = stream(); diff --git a/src/test/bench/task-perf-one-million.rs b/src/test/bench/task-perf-one-million.rs index 56e981b735d..e1a5253444f 100644 --- a/src/test/bench/task-perf-one-million.rs +++ b/src/test/bench/task-perf-one-million.rs @@ -11,6 +11,10 @@ // Test for concurrent tasks use std::comm::*; +use std::os; +use std::task; +use std::uint; +use std::vec; fn calc(children: uint, parent_wait_chan: &Chan<Chan<Chan<int>>>) { diff --git a/src/test/bench/task-perf-spawnalot.rs b/src/test/bench/task-perf-spawnalot.rs index e6da898a034..1a8fc7e098d 100644 --- a/src/test/bench/task-perf-spawnalot.rs +++ b/src/test/bench/task-perf-spawnalot.rs @@ -8,6 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::os; +use std::task; +use std::uint; + fn f(n: uint) { let mut i = 0u; while i < n { diff --git a/src/test/compile-fail/assign-to-method.rs b/src/test/compile-fail/assign-to-method.rs index 4993846f445..55a358a32e2 100644 --- a/src/test/compile-fail/assign-to-method.rs +++ b/src/test/compile-fail/assign-to-method.rs @@ -9,7 +9,7 @@ // except according to those terms. struct cat { - priv mut meows : uint, + priv meows : uint, how_hungry : int, } diff --git a/src/test/compile-fail/bind-by-move-no-guards.rs b/src/test/compile-fail/bind-by-move-no-guards.rs index ffc160ac111..348781d7497 100644 --- a/src/test/compile-fail/bind-by-move-no-guards.rs +++ b/src/test/compile-fail/bind-by-move-no-guards.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::comm; + fn main() { let (p,c) = comm::stream(); let x = Some(p); diff --git a/src/test/compile-fail/block-arg-as-stmt-with-value.rs b/src/test/compile-fail/block-arg-as-stmt-with-value.rs index 73a53d6cc98..dc90dfb2cad 100644 --- a/src/test/compile-fail/block-arg-as-stmt-with-value.rs +++ b/src/test/compile-fail/block-arg-as-stmt-with-value.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; fn compute1() -> float { let v = ~[0f, 1f, 2f, 3f]; diff --git a/src/test/compile-fail/block-must-not-have-result-for.rs b/src/test/compile-fail/block-must-not-have-result-for.rs index d1e001f722c..778309122cb 100644 --- a/src/test/compile-fail/block-must-not-have-result-for.rs +++ b/src/test/compile-fail/block-must-not-have-result-for.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + fn main() { for vec::each(~[0]) |_i| { //~ ERROR A for-loop body must return (), but true diff --git a/src/test/compile-fail/borrowck-auto-mut-ref-to-immut-var.rs b/src/test/compile-fail/borrowck-auto-mut-ref-to-immut-var.rs index 2ba5d0473cc..b9758e669e0 100644 --- a/src/test/compile-fail/borrowck-auto-mut-ref-to-immut-var.rs +++ b/src/test/compile-fail/borrowck-auto-mut-ref-to-immut-var.rs @@ -10,6 +10,8 @@ // Tests that auto-ref can't create mutable aliases to immutable memory. +use std::io; + struct Foo { x: int } diff --git a/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs b/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs index 50dd815d493..1e74e91a821 100644 --- a/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs +++ b/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::task; + fn borrow(v: &int, f: &fn(x: &int)) { f(v); } diff --git a/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs b/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs index 9ea4fe8aef4..01ca3cd1c28 100644 --- a/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs +++ b/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs @@ -22,7 +22,7 @@ use std::either::{Either, Left, Right}; fn g() { let mut x: Either<int,float> = Left(3); - io::println(f(&mut x, &x).to_str()); //~ ERROR cannot borrow + println(f(&mut x, &x).to_str()); //~ ERROR cannot borrow } fn h() { diff --git a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs index 061a6c553e4..443bcc92183 100644 --- a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs +++ b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs @@ -13,7 +13,7 @@ struct Point { y: int, } -impl ops::Add<int,int> for Point { +impl Add<int,int> for Point { fn add(&self, z: &int) -> int { self.x + self.y + (*z) } diff --git a/src/test/compile-fail/borrowck-ref-into-rvalue.rs b/src/test/compile-fail/borrowck-ref-into-rvalue.rs index 7026f06c2b7..cb56e929754 100644 --- a/src/test/compile-fail/borrowck-ref-into-rvalue.rs +++ b/src/test/compile-fail/borrowck-ref-into-rvalue.rs @@ -16,5 +16,5 @@ fn main() { }, None => { fail!() } } - io::println(*msg); + println(*msg); } diff --git a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs index 6f669e67ec7..c02a0b4cfaf 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs @@ -9,5 +9,5 @@ fn a() -> &int { fn main() { let fifth = a(); - io::println(fmt!("%d", *fifth)); + println(fmt!("%d", *fifth)); } diff --git a/src/test/compile-fail/by-move-pattern-binding.rs b/src/test/compile-fail/by-move-pattern-binding.rs index dc42e28ec25..8c0cf68c164 100644 --- a/src/test/compile-fail/by-move-pattern-binding.rs +++ b/src/test/compile-fail/by-move-pattern-binding.rs @@ -17,6 +17,6 @@ fn main() { }; match &s.x { &Foo => {} - &Bar(ref identifier) => io::println(*identifier) + &Bar(ref identifier) => println(*identifier) }; } diff --git a/src/test/compile-fail/class-cast-to-trait.rs b/src/test/compile-fail/class-cast-to-trait.rs index 06627365451..8df9650d950 100644 --- a/src/test/compile-fail/class-cast-to-trait.rs +++ b/src/test/compile-fail/class-cast-to-trait.rs @@ -13,9 +13,9 @@ trait noisy { } struct cat { - priv mut meows : uint, + priv meows : uint, - mut how_hungry : int, + how_hungry : int, name : ~str, } diff --git a/src/test/compile-fail/class-missing-self.rs b/src/test/compile-fail/class-missing-self.rs index b78b065d028..4d1c22dfabe 100644 --- a/src/test/compile-fail/class-missing-self.rs +++ b/src/test/compile-fail/class-missing-self.rs @@ -9,7 +9,7 @@ // except according to those terms. struct cat { - priv mut meows : uint, + priv meows : uint, } priv impl cat { diff --git a/src/test/compile-fail/die-not-static.rs b/src/test/compile-fail/die-not-static.rs index d33c591d8c8..c7f5e271818 100644 --- a/src/test/compile-fail/die-not-static.rs +++ b/src/test/compile-fail/die-not-static.rs @@ -1,3 +1,5 @@ +use std::str; + fn main() { let v = ~"test"; let sslice = str::slice(v, 0, v.len()); diff --git a/src/test/compile-fail/drop-on-non-struct.rs b/src/test/compile-fail/drop-on-non-struct.rs index b2f87686ac6..5e422d26753 100644 --- a/src/test/compile-fail/drop-on-non-struct.rs +++ b/src/test/compile-fail/drop-on-non-struct.rs @@ -13,7 +13,7 @@ type Foo = @[u8]; impl Drop for Foo { //~ ERROR the Drop trait may only be implemented //~^ ERROR cannot provide an extension implementation fn finalize(&self) { - io::println("kaboom"); + println("kaboom"); } } diff --git a/src/test/compile-fail/explicit-call-to-dtor.rs b/src/test/compile-fail/explicit-call-to-dtor.rs index 24fedaaabe3..ce2942c3146 100644 --- a/src/test/compile-fail/explicit-call-to-dtor.rs +++ b/src/test/compile-fail/explicit-call-to-dtor.rs @@ -14,7 +14,7 @@ struct Foo { impl Drop for Foo { fn finalize(&self) { - io::println("kaboom"); + println("kaboom"); } } diff --git a/src/test/compile-fail/explicit-call-to-supertrait-dtor.rs b/src/test/compile-fail/explicit-call-to-supertrait-dtor.rs index fd49889a3f7..1a5eb696fa2 100644 --- a/src/test/compile-fail/explicit-call-to-supertrait-dtor.rs +++ b/src/test/compile-fail/explicit-call-to-supertrait-dtor.rs @@ -18,7 +18,7 @@ trait Bar : Drop { impl Drop for Foo { fn finalize(&self) { - io::println("kaboom"); + println("kaboom"); } } diff --git a/src/test/compile-fail/foreign-unsafe-fn.rs b/src/test/compile-fail/foreign-unsafe-fn.rs deleted file mode 100644 index fce269ab517..00000000000 --- a/src/test/compile-fail/foreign-unsafe-fn.rs +++ /dev/null @@ -1,23 +0,0 @@ -// -*- rust -*- -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -mod test { - #[abi = "cdecl"] - pub extern { - pub unsafe fn free(); - } -} - -fn main() { - let x = test::free; - //~^ ERROR call to unsafe function requires unsafe function or block -} diff --git a/src/test/compile-fail/issue-2151.rs b/src/test/compile-fail/issue-2151.rs index bb6d47a4762..8f4bbe4eabc 100644 --- a/src/test/compile-fail/issue-2151.rs +++ b/src/test/compile-fail/issue-2151.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + fn main() { for vec::each(fail!()) |i| { let _ = i * 2; //~ ERROR the type of this value must be known diff --git a/src/test/compile-fail/issue-2548.rs b/src/test/compile-fail/issue-2548.rs index fdaf1f562c8..2f690008440 100644 --- a/src/test/compile-fail/issue-2548.rs +++ b/src/test/compile-fail/issue-2548.rs @@ -20,7 +20,7 @@ struct foo { impl Drop for foo { fn finalize(&self) { unsafe { - io::println("Goodbye, World!"); + println("Goodbye, World!"); *self.x += 1; } } diff --git a/src/test/compile-fail/issue-2817-2.rs b/src/test/compile-fail/issue-2817-2.rs index 17b0d88a6a8..166f7e048df 100644 --- a/src/test/compile-fail/issue-2817-2.rs +++ b/src/test/compile-fail/issue-2817-2.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::uint; + fn not_bool(f: &fn(int) -> ~str) -> bool {} fn main() { diff --git a/src/test/compile-fail/issue-2817.rs b/src/test/compile-fail/issue-2817.rs index 77585d15b6b..49516831904 100644 --- a/src/test/compile-fail/issue-2817.rs +++ b/src/test/compile-fail/issue-2817.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::uint; + fn uuid() -> uint { fail!(); } fn from_str(s: ~str) -> uint { fail!(); } diff --git a/src/test/compile-fail/issue-3044.rs b/src/test/compile-fail/issue-3044.rs index 06fb18d7e47..4cac844bdea 100644 --- a/src/test/compile-fail/issue-3044.rs +++ b/src/test/compile-fail/issue-3044.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + fn main() { let needlesArr: ~[char] = ~['a', 'f']; do vec::foldr(needlesArr) |x, y| { diff --git a/src/test/compile-fail/issue-3096-2.rs b/src/test/compile-fail/issue-3096-2.rs index eb58cf3e13b..5f3af865454 100644 --- a/src/test/compile-fail/issue-3096-2.rs +++ b/src/test/compile-fail/issue-3096-2.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::ptr; + enum bottom { } fn main() { diff --git a/src/test/compile-fail/issue-3344.rs b/src/test/compile-fail/issue-3344.rs index e931a8fa7e1..ac5b469c56e 100644 --- a/src/test/compile-fail/issue-3344.rs +++ b/src/test/compile-fail/issue-3344.rs @@ -9,7 +9,7 @@ // except according to those terms. struct thing(uint); -impl cmp::Ord for thing { //~ ERROR missing method `gt` +impl Ord for thing { //~ ERROR missing method `gt` fn lt(&self, other: &thing) -> bool { **self < **other } fn le(&self, other: &thing) -> bool { **self < **other } fn ge(&self, other: &thing) -> bool { **self < **other } diff --git a/src/test/compile-fail/issue-3651.rs b/src/test/compile-fail/issue-3651.rs index 8d704859fe5..7e65d8ab82d 100644 --- a/src/test/compile-fail/issue-3651.rs +++ b/src/test/compile-fail/issue-3651.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::task; + fn main() { for task::spawn { return true; } //~ ERROR A `for` loop iterator should expect a closure that //~^ ERROR expected `for` closure to return `bool` diff --git a/src/test/compile-fail/issue-3820.rs b/src/test/compile-fail/issue-3820.rs index 2bd11b5111a..8fafd04d1e2 100644 --- a/src/test/compile-fail/issue-3820.rs +++ b/src/test/compile-fail/issue-3820.rs @@ -22,5 +22,5 @@ fn main() { let u = Thing {x: 2}; let _v = u.mul(&3); // This is ok let w = u * 3; //~ ERROR binary operation * cannot be applied to type `Thing` - io::println(fmt!("%i", w.x)); + println(fmt!("%i", w.x)); } diff --git a/src/test/compile-fail/issue-3953.rs b/src/test/compile-fail/issue-3953.rs index fc8e456f56b..e3af6ce78e2 100644 --- a/src/test/compile-fail/issue-3953.rs +++ b/src/test/compile-fail/issue-3953.rs @@ -31,8 +31,8 @@ impl Eq for Lol { fn main() { if Lol(2) == Lol(4) { - io::println("2 == 4"); + println("2 == 4"); } else { - io::println("2 != 4"); + println("2 != 4"); } } diff --git a/src/test/compile-fail/issue-4335.rs b/src/test/compile-fail/issue-4335.rs index 5f907b35e41..ffa11e59260 100644 --- a/src/test/compile-fail/issue-4335.rs +++ b/src/test/compile-fail/issue-4335.rs @@ -14,5 +14,5 @@ fn f<'r, T>(v: &'r T) -> &'r fn()->T { id::<&'r fn()->T>(|| *v) } //~ ERROR cann fn main() { let v = &5; - io::println(fmt!("%d", f(v)())); + println(fmt!("%d", f(v)())); } diff --git a/src/test/compile-fail/issue-511.rs b/src/test/compile-fail/issue-511.rs index a053424b30d..ed2eede76c6 100644 --- a/src/test/compile-fail/issue-511.rs +++ b/src/test/compile-fail/issue-511.rs @@ -12,10 +12,10 @@ extern mod extra; use std::cmp::Eq; fn f<T:Eq>(o: &mut Option<T>) { - assert!(*o == option::None); + assert!(*o == None); } fn main() { - f::<int>(&mut option::None); + f::<int>(&mut None); //~^ ERROR cannot borrow } diff --git a/src/test/compile-fail/kindck-implicit-close-over-mut-var.rs b/src/test/compile-fail/kindck-implicit-close-over-mut-var.rs index c2732d383ab..b21063361ab 100644 --- a/src/test/compile-fail/kindck-implicit-close-over-mut-var.rs +++ b/src/test/compile-fail/kindck-implicit-close-over-mut-var.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::task; + fn user(_i: int) {} fn foo() { diff --git a/src/test/compile-fail/lint-default-methods.rs b/src/test/compile-fail/lint-default-methods.rs index 89b99fcebca..23befde7559 100644 --- a/src/test/compile-fail/lint-default-methods.rs +++ b/src/test/compile-fail/lint-default-methods.rs @@ -1,7 +1,7 @@ #[forbid(default_methods)]; trait Foo { //~ ERROR default methods are experimental - fn bar(&self) { io::println("hi"); } + fn bar(&self) { println("hi"); } } fn main() {} diff --git a/src/test/compile-fail/lint-unused-imports.rs b/src/test/compile-fail/lint-unused-imports.rs index 201b2e9b989..4a748cc5670 100644 --- a/src/test/compile-fail/lint-unused-imports.rs +++ b/src/test/compile-fail/lint-unused-imports.rs @@ -12,6 +12,8 @@ use cal = bar::c::cc; +use std::io; + use std::either::Right; //~ ERROR unused import use std::util::*; // shouldn't get errors for not using diff --git a/src/test/compile-fail/lint-unused-unsafe.rs b/src/test/compile-fail/lint-unused-unsafe.rs index 465e5548f67..1b5aabb9537 100644 --- a/src/test/compile-fail/lint-unused-unsafe.rs +++ b/src/test/compile-fail/lint-unused-unsafe.rs @@ -27,8 +27,8 @@ unsafe fn bad3() { unsafe {} } //~ ERROR: unnecessary `unsafe` block fn bad4() { unsafe { do callback {} } } //~ ERROR: unnecessary `unsafe` block unsafe fn bad5() { unsafe { unsf() } } //~ ERROR: unnecessary `unsafe` block fn bad6() { - unsafe { //~ ERROR: unnecessary `unsafe` block - unsafe { // don't put the warning here + unsafe { // don't put the warning here + unsafe { //~ ERROR: unnecessary `unsafe` block unsf() } } diff --git a/src/test/compile-fail/liveness-issue-2163.rs b/src/test/compile-fail/liveness-issue-2163.rs index 914b7d9d677..ec4f3f9a3fd 100644 --- a/src/test/compile-fail/liveness-issue-2163.rs +++ b/src/test/compile-fail/liveness-issue-2163.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + fn main() { let a: ~[int] = ~[]; vec::each(a, |_| -> bool { diff --git a/src/test/compile-fail/match-vec-unreachable.rs b/src/test/compile-fail/match-vec-unreachable.rs index 2719d84b2dd..3930e7d2192 100644 --- a/src/test/compile-fail/match-vec-unreachable.rs +++ b/src/test/compile-fail/match-vec-unreachable.rs @@ -7,7 +7,7 @@ fn main() { } match [~"foo", ~"bar", ~"baz"] { - [a, _, _, .._] => { io::println(a); } + [a, _, _, .._] => { println(a); } [~"foo", ~"bar", ~"baz", ~"foo", ~"bar"] => { } //~ ERROR unreachable pattern _ => { } } diff --git a/src/test/compile-fail/moves-based-on-type-block-bad.rs b/src/test/compile-fail/moves-based-on-type-block-bad.rs index ca58097b555..11c4d078208 100644 --- a/src/test/compile-fail/moves-based-on-type-block-bad.rs +++ b/src/test/compile-fail/moves-based-on-type-block-bad.rs @@ -18,7 +18,7 @@ fn main() { do f(&s) |hellothere| { match hellothere.x { ~Foo(_) => {} - ~Bar(x) => io::println(x.to_str()), //~ ERROR cannot move out + ~Bar(x) => println(x.to_str()), //~ ERROR cannot move out ~Baz => {} } } diff --git a/src/test/compile-fail/moves-based-on-type-capture-clause-bad.rs b/src/test/compile-fail/moves-based-on-type-capture-clause-bad.rs index 6dce011ddc8..706ab051ca1 100644 --- a/src/test/compile-fail/moves-based-on-type-capture-clause-bad.rs +++ b/src/test/compile-fail/moves-based-on-type-capture-clause-bad.rs @@ -1,7 +1,9 @@ +use std::task; + fn main() { let x = ~"Hello world!"; do task::spawn { - io::println(x); + println(x); } - io::println(x); //~ ERROR use of moved value + println(x); //~ ERROR use of moved value } diff --git a/src/test/compile-fail/moves-based-on-type-exprs.rs b/src/test/compile-fail/moves-based-on-type-exprs.rs index 40ee37fae78..d39b2e06e69 100644 --- a/src/test/compile-fail/moves-based-on-type-exprs.rs +++ b/src/test/compile-fail/moves-based-on-type-exprs.rs @@ -1,6 +1,8 @@ // Tests that references to move-by-default values trigger moves when // they occur as part of various kinds of expressions. +use std::vec; + struct Foo<A> { f: A } fn guard(_s: ~str) -> bool {fail!()} fn touch<A>(_a: &A) {} diff --git a/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs b/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs index ecd58d485a8..e25ba0f39f2 100644 --- a/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs +++ b/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::uint; + fn test(_x: ~uint) {} fn main() { diff --git a/src/test/compile-fail/mutable-class-fields-2.rs b/src/test/compile-fail/mutable-class-fields-2.rs index f5d24b31641..7d41481354f 100644 --- a/src/test/compile-fail/mutable-class-fields-2.rs +++ b/src/test/compile-fail/mutable-class-fields-2.rs @@ -9,7 +9,7 @@ // except according to those terms. struct cat { - priv mut meows : uint, + priv meows : uint, how_hungry : int, } diff --git a/src/test/compile-fail/mutable-class-fields.rs b/src/test/compile-fail/mutable-class-fields.rs index 8bebec7134c..a88156a4b47 100644 --- a/src/test/compile-fail/mutable-class-fields.rs +++ b/src/test/compile-fail/mutable-class-fields.rs @@ -9,7 +9,7 @@ // except according to those terms. struct cat { - priv mut meows : uint, + priv meows : uint, how_hungry : int, } diff --git a/src/test/compile-fail/no-capture-arc.rs b/src/test/compile-fail/no-capture-arc.rs index 2a83e479e87..b036071fd87 100644 --- a/src/test/compile-fail/no-capture-arc.rs +++ b/src/test/compile-fail/no-capture-arc.rs @@ -13,6 +13,8 @@ extern mod extra; use extra::arc; +use std::task; + fn main() { let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; let arc_v = arc::ARC(v); diff --git a/src/test/compile-fail/no-reuse-move-arc.rs b/src/test/compile-fail/no-reuse-move-arc.rs index c9e5144557a..28f3ea7af9f 100644 --- a/src/test/compile-fail/no-reuse-move-arc.rs +++ b/src/test/compile-fail/no-reuse-move-arc.rs @@ -11,6 +11,8 @@ extern mod extra; use extra::arc; +use std::task; + fn main() { let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; let arc_v = arc::ARC(v); diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs index 951103bfbe3..9847efd2dd5 100644 --- a/src/test/compile-fail/no-send-res-ports.rs +++ b/src/test/compile-fail/no-send-res-ports.rs @@ -9,6 +9,7 @@ // except according to those terms. use std::cell::Cell; +use std::task; struct Port<T>(@T); diff --git a/src/test/compile-fail/non-copyable-void.rs b/src/test/compile-fail/non-copyable-void.rs index b89e22582bb..f979f8273a0 100644 --- a/src/test/compile-fail/non-copyable-void.rs +++ b/src/test/compile-fail/non-copyable-void.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::libc; + fn main() { let x : *~[int] = &~[1,2,3]; let y : *libc::c_void = x as *libc::c_void; diff --git a/src/test/compile-fail/noncopyable-match-pattern.rs b/src/test/compile-fail/noncopyable-match-pattern.rs index 155b3981483..a7c8950486c 100644 --- a/src/test/compile-fail/noncopyable-match-pattern.rs +++ b/src/test/compile-fail/noncopyable-match-pattern.rs @@ -8,12 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::unstable; + fn main() { - let x = Some(unstable::sync::exclusive(false)); - match x { - Some(copy z) => { //~ ERROR copying a value of non-copyable type - do z.with |b| { assert!(!*b); } + unsafe { + let x = Some(unstable::sync::exclusive(false)); + match x { + Some(copy z) => { //~ ERROR copying a value of non-copyable type + do z.with |b| { assert!(!*b); } + } + None => fail!() } - None => fail!() } } diff --git a/src/test/compile-fail/packed-struct-generic-transmute.rs b/src/test/compile-fail/packed-struct-generic-transmute.rs index c03261816ef..3b9b17e051d 100644 --- a/src/test/compile-fail/packed-struct-generic-transmute.rs +++ b/src/test/compile-fail/packed-struct-generic-transmute.rs @@ -15,6 +15,8 @@ // error-pattern: transmute called on types with different size +use std::cast; + #[packed] struct Foo<T,S> { bar: T, diff --git a/src/test/compile-fail/packed-struct-transmute.rs b/src/test/compile-fail/packed-struct-transmute.rs index cad78f9e5d1..bf62bab8b40 100644 --- a/src/test/compile-fail/packed-struct-transmute.rs +++ b/src/test/compile-fail/packed-struct-transmute.rs @@ -15,6 +15,8 @@ // error-pattern: transmute called on types with different size +use std::cast; + #[packed] struct Foo { bar: u8, diff --git a/src/test/compile-fail/private-method.rs b/src/test/compile-fail/private-method.rs index 0d84bc2fc60..800bb1c5703 100644 --- a/src/test/compile-fail/private-method.rs +++ b/src/test/compile-fail/private-method.rs @@ -11,8 +11,10 @@ // error-pattern:method `nap` is private mod kitties { + use std::uint; + pub struct cat { - priv mut meows : uint, + priv meows : uint, how_hungry : int, } diff --git a/src/test/compile-fail/refutable-pattern-in-fn-arg.rs b/src/test/compile-fail/refutable-pattern-in-fn-arg.rs index 957925709e1..524deed20f2 100644 --- a/src/test/compile-fail/refutable-pattern-in-fn-arg.rs +++ b/src/test/compile-fail/refutable-pattern-in-fn-arg.rs @@ -9,6 +9,6 @@ // except according to those terms. fn main() { - let f = |3: int| io::println("hello"); //~ ERROR refutable pattern + let f = |3: int| println("hello"); //~ ERROR refutable pattern f(4); } diff --git a/src/test/compile-fail/regions-addr-of-upvar-self.rs b/src/test/compile-fail/regions-addr-of-upvar-self.rs index b9a9e2f38f5..1c7235743ea 100644 --- a/src/test/compile-fail/regions-addr-of-upvar-self.rs +++ b/src/test/compile-fail/regions-addr-of-upvar-self.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::uint; + struct dog { food: uint, } diff --git a/src/test/compile-fail/repeat-to-run-dtor-twice.rs b/src/test/compile-fail/repeat-to-run-dtor-twice.rs index e1e1e2313f4..0dd12822dfa 100644 --- a/src/test/compile-fail/repeat-to-run-dtor-twice.rs +++ b/src/test/compile-fail/repeat-to-run-dtor-twice.rs @@ -18,7 +18,7 @@ struct Foo { impl Drop for Foo { fn finalize(&self) { - io::println("Goodbye!"); + println("Goodbye!"); } } diff --git a/src/test/compile-fail/spawn-non-nil-fn.rs b/src/test/compile-fail/spawn-non-nil-fn.rs index 9dbef369257..8db2c686f30 100644 --- a/src/test/compile-fail/spawn-non-nil-fn.rs +++ b/src/test/compile-fail/spawn-non-nil-fn.rs @@ -12,4 +12,6 @@ extern mod extra; +use std::task; + fn main() { task::spawn(|| -> int { 10 }); } diff --git a/src/test/compile-fail/tuple-struct-nonexhaustive.rs b/src/test/compile-fail/tuple-struct-nonexhaustive.rs index de28a06abab..785eeb24784 100644 --- a/src/test/compile-fail/tuple-struct-nonexhaustive.rs +++ b/src/test/compile-fail/tuple-struct-nonexhaustive.rs @@ -13,7 +13,7 @@ struct Foo(int, int); fn main() { let x = Foo(1, 2); match x { //~ ERROR non-exhaustive - Foo(1, b) => io::println(fmt!("%d", b)), - Foo(2, b) => io::println(fmt!("%d", b)) + Foo(1, b) => println(fmt!("%d", b)), + Foo(2, b) => println(fmt!("%d", b)) } } diff --git a/src/test/compile-fail/unique-object-noncopyable.rs b/src/test/compile-fail/unique-object-noncopyable.rs index 95945b0b5ba..3844dab726e 100644 --- a/src/test/compile-fail/unique-object-noncopyable.rs +++ b/src/test/compile-fail/unique-object-noncopyable.rs @@ -22,7 +22,7 @@ impl Drop for Bar { impl Foo for Bar { fn f(&self) { - io::println("hi"); + println("hi"); } } diff --git a/src/test/compile-fail/unsendable-class.rs b/src/test/compile-fail/unsendable-class.rs index 3eebc4647c2..58de0926f7c 100644 --- a/src/test/compile-fail/unsendable-class.rs +++ b/src/test/compile-fail/unsendable-class.rs @@ -11,6 +11,8 @@ // Test that a class with an unsendable field can't be // sent +use std::comm; + struct foo { i: int, j: @~str, diff --git a/src/test/compile-fail/unsupported-cast.rs b/src/test/compile-fail/unsupported-cast.rs index 3af012a6c3f..da8f69d7eae 100644 --- a/src/test/compile-fail/unsupported-cast.rs +++ b/src/test/compile-fail/unsupported-cast.rs @@ -10,6 +10,8 @@ // error-pattern:unsupported cast +use std::libc; + fn main() { debug!(1.0 as *libc::FILE); // Can't cast float to foreign. } diff --git a/src/test/compile-fail/use-after-move-based-on-type.rs b/src/test/compile-fail/use-after-move-based-on-type.rs index 3d176bb339d..e8802e6e5cb 100644 --- a/src/test/compile-fail/use-after-move-based-on-type.rs +++ b/src/test/compile-fail/use-after-move-based-on-type.rs @@ -11,5 +11,5 @@ fn main() { let x = ~"Hello!"; let _y = x; - io::println(x); //~ ERROR use of moved value + println(x); //~ ERROR use of moved value } diff --git a/src/test/compile-fail/use-after-move-self-based-on-type.rs b/src/test/compile-fail/use-after-move-self-based-on-type.rs index da8e0c9f2b6..e4e5802fafb 100644 --- a/src/test/compile-fail/use-after-move-self-based-on-type.rs +++ b/src/test/compile-fail/use-after-move-self-based-on-type.rs @@ -17,5 +17,5 @@ pub impl S { fn main() { let x = S { x: 1 }; - io::println(x.foo().to_str()); + println(x.foo().to_str()); } diff --git a/src/test/compile-fail/use-after-move-self.rs b/src/test/compile-fail/use-after-move-self.rs index 37db40d1436..4750a5fbd2d 100644 --- a/src/test/compile-fail/use-after-move-self.rs +++ b/src/test/compile-fail/use-after-move-self.rs @@ -13,5 +13,5 @@ pub impl S { fn main() { let x = S { x: ~1 }; - io::println(x.foo().to_str()); + println(x.foo().to_str()); } diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow.rs b/src/test/run-fail/bug-2470-bounds-check-overflow.rs index 6a6402c6a5e..bd7d86d7295 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow.rs +++ b/src/test/run-fail/bug-2470-bounds-check-overflow.rs @@ -10,6 +10,9 @@ // error-pattern:index out of bounds +use std::sys; +use std::vec; + fn main() { // This should cause a bounds-check failure, but may not if we do our diff --git a/src/test/run-fail/extern-fail.rs b/src/test/run-fail/extern-fail.rs index 15cc8a48867..2be41d3bed0 100644 --- a/src/test/run-fail/extern-fail.rs +++ b/src/test/run-fail/extern-fail.rs @@ -12,9 +12,13 @@ // Testing that runtime failure doesn't cause callbacks to abort abnormally. // Instead the failure will be delivered after the callbacks return. +use std::libc; use std::old_iter; +use std::task; mod rustrt { + use std::libc; + pub extern { pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; diff --git a/src/test/run-fail/for-each-loop-fail.rs b/src/test/run-fail/for-each-loop-fail.rs index 06422244af9..97ca36cf448 100644 --- a/src/test/run-fail/for-each-loop-fail.rs +++ b/src/test/run-fail/for-each-loop-fail.rs @@ -10,4 +10,7 @@ // error-pattern:moop extern mod extra; + +use std::uint; + fn main() { for uint::range(0u, 10u) |_i| { fail!("moop"); } } diff --git a/src/test/run-fail/issue-2156.rs b/src/test/run-fail/issue-2156.rs index de0b903b53c..0e0bd81d659 100644 --- a/src/test/run-fail/issue-2156.rs +++ b/src/test/run-fail/issue-2156.rs @@ -11,7 +11,9 @@ // error-pattern:explicit failure // Don't double free the string extern mod extra; + use std::io::ReaderUtil; +use std::io; fn main() { do io::with_str_reader(~"") |rdr| { diff --git a/src/test/run-fail/linked-failure.rs b/src/test/run-fail/linked-failure.rs index 6a87e202d13..41a9d7ddcea 100644 --- a/src/test/run-fail/linked-failure.rs +++ b/src/test/run-fail/linked-failure.rs @@ -13,6 +13,9 @@ // error-pattern:1 == 2 extern mod extra; +use std::comm; +use std::task; + fn child() { assert!((1 == 2)); } fn main() { diff --git a/src/test/run-fail/linked-failure2.rs b/src/test/run-fail/linked-failure2.rs index 9f09c16ed6a..0269e395986 100644 --- a/src/test/run-fail/linked-failure2.rs +++ b/src/test/run-fail/linked-failure2.rs @@ -12,6 +12,9 @@ // error-pattern:fail +use std::comm; +use std::task; + fn child() { fail!(); } fn main() { diff --git a/src/test/run-fail/linked-failure3.rs b/src/test/run-fail/linked-failure3.rs index 4b09cb75324..1203f74322f 100644 --- a/src/test/run-fail/linked-failure3.rs +++ b/src/test/run-fail/linked-failure3.rs @@ -12,6 +12,9 @@ // error-pattern:fail +use std::comm; +use std::task; + fn grandchild() { fail!("grandchild dies"); } fn child() { diff --git a/src/test/run-fail/linked-failure4.rs b/src/test/run-fail/linked-failure4.rs index 3dc87e190a5..766b43f211f 100644 --- a/src/test/run-fail/linked-failure4.rs +++ b/src/test/run-fail/linked-failure4.rs @@ -11,6 +11,9 @@ // error-pattern:1 == 2 +use std::comm; +use std::task; + fn child() { assert!((1 == 2)); } fn parent() { diff --git a/src/test/run-fail/match-wildcards.rs b/src/test/run-fail/match-wildcards.rs index 306357b0001..22613f45b3b 100644 --- a/src/test/run-fail/match-wildcards.rs +++ b/src/test/run-fail/match-wildcards.rs @@ -10,9 +10,9 @@ // error-pattern:squirrelcupcake fn cmp() -> int { - match (option::Some('a'), option::None::<char>) { - (option::Some(_), _) => { fail!("squirrelcupcake"); } - (_, option::Some(_)) => { fail!(); } + match (Some('a'), None::<char>) { + (Some(_), _) => { fail!("squirrelcupcake"); } + (_, Some(_)) => { fail!(); } _ => { fail!("wat"); } } } diff --git a/src/test/run-fail/morestack2.rs b/src/test/run-fail/morestack2.rs index f829767edf1..d03433d5872 100644 --- a/src/test/run-fail/morestack2.rs +++ b/src/test/run-fail/morestack2.rs @@ -17,7 +17,12 @@ extern mod extra; +use std::libc; +use std::task; + mod rustrt { + use std::libc; + pub extern { pub fn rust_get_argc() -> libc::c_int; } diff --git a/src/test/run-fail/morestack3.rs b/src/test/run-fail/morestack3.rs index 6ab064f3827..d2e17d28561 100644 --- a/src/test/run-fail/morestack3.rs +++ b/src/test/run-fail/morestack3.rs @@ -14,6 +14,8 @@ extern mod extra; +use std::task; + fn getbig_and_fail(i: int) { let _r = and_then_get_big_again(5); if i != 0 { diff --git a/src/test/run-fail/morestack4.rs b/src/test/run-fail/morestack4.rs index e07c7997108..c4f7de49555 100644 --- a/src/test/run-fail/morestack4.rs +++ b/src/test/run-fail/morestack4.rs @@ -14,6 +14,8 @@ extern mod extra; +use std::task; + fn getbig_and_fail(i: int) { let r = and_then_get_big_again(5); if i != 0 { diff --git a/src/test/run-fail/result-get-fail.rs b/src/test/run-fail/result-get-fail.rs index 1e4e7685e27..cb9cce3249f 100644 --- a/src/test/run-fail/result-get-fail.rs +++ b/src/test/run-fail/result-get-fail.rs @@ -9,6 +9,9 @@ // except according to those terms. // error-pattern:get called on error result: ~"kitty" + +use std::result; + fn main() { error!(result::get(&result::Err::<int,~str>(~"kitty"))); } diff --git a/src/test/run-fail/rt-set-exit-status-fail.rs b/src/test/run-fail/rt-set-exit-status-fail.rs index f6e9602470f..6b5c2b554a4 100644 --- a/src/test/run-fail/rt-set-exit-status-fail.rs +++ b/src/test/run-fail/rt-set-exit-status-fail.rs @@ -10,6 +10,8 @@ // error-pattern:whatever +use std::os; + fn main() { error!(~"whatever"); // Setting the exit status only works when the scheduler terminates diff --git a/src/test/run-fail/rt-set-exit-status-fail2.rs b/src/test/run-fail/rt-set-exit-status-fail2.rs index bf33b10cc61..3d0341d01f4 100644 --- a/src/test/run-fail/rt-set-exit-status-fail2.rs +++ b/src/test/run-fail/rt-set-exit-status-fail2.rs @@ -10,6 +10,9 @@ // error-pattern:whatever +use std::os; +use std::task; + struct r { x:int, } diff --git a/src/test/run-fail/rt-set-exit-status.rs b/src/test/run-fail/rt-set-exit-status.rs index 2cff4ff09df..4f71cdc67e9 100644 --- a/src/test/run-fail/rt-set-exit-status.rs +++ b/src/test/run-fail/rt-set-exit-status.rs @@ -10,6 +10,8 @@ // error-pattern:whatever +use std::os; + fn main() { error!(~"whatever"); // 101 is the code the runtime uses on task failure and the value diff --git a/src/test/run-fail/small-negative-indexing.rs b/src/test/run-fail/small-negative-indexing.rs index 87df00fcce5..ee58f76fc99 100644 --- a/src/test/run-fail/small-negative-indexing.rs +++ b/src/test/run-fail/small-negative-indexing.rs @@ -9,6 +9,9 @@ // except according to those terms. // error-pattern:index out of bounds: the len is 1024 but the index is -1 + +use std::vec; + fn main() { let v = vec::from_fn(1024u, {|n| n}); // this should trip a bounds check diff --git a/src/test/run-fail/spawnfail.rs b/src/test/run-fail/spawnfail.rs index fc4977308ae..de085a6f3ad 100644 --- a/src/test/run-fail/spawnfail.rs +++ b/src/test/run-fail/spawnfail.rs @@ -12,6 +12,8 @@ // error-pattern:explicit extern mod extra; +use std::task; + // We don't want to see any invalid reads fn main() { fn f() { diff --git a/src/test/run-fail/task-comm-recv-block.rs b/src/test/run-fail/task-comm-recv-block.rs index ca411872b61..8302b96ca3e 100644 --- a/src/test/run-fail/task-comm-recv-block.rs +++ b/src/test/run-fail/task-comm-recv-block.rs @@ -10,6 +10,9 @@ // error-pattern:goodfail +use std::comm; +use std::task; + fn goodfail() { task::yield(); fail!("goodfail"); diff --git a/src/test/run-fail/task-spawn-barefn.rs b/src/test/run-fail/task-spawn-barefn.rs index 11c9de6e14f..2456f968c3c 100644 --- a/src/test/run-fail/task-spawn-barefn.rs +++ b/src/test/run-fail/task-spawn-barefn.rs @@ -10,6 +10,9 @@ // error-pattern:Ensure that the child task runs by failing +use std::str; +use std::task; + fn main() { // the purpose of this test is to make sure that task::spawn() // works when provided with a bare function: diff --git a/src/test/run-fail/unwind-box-res.rs b/src/test/run-fail/unwind-box-res.rs index d5d54ade444..a1e1ee433bb 100644 --- a/src/test/run-fail/unwind-box-res.rs +++ b/src/test/run-fail/unwind-box-res.rs @@ -10,6 +10,8 @@ // error-pattern:fail +use std::cast; + fn failfn() { fail!(); } diff --git a/src/test/run-pass/anon-extern-mod-cross-crate-2.rs b/src/test/run-pass/anon-extern-mod-cross-crate-2.rs index ed57b32b3d9..4eeb85469de 100644 --- a/src/test/run-pass/anon-extern-mod-cross-crate-2.rs +++ b/src/test/run-pass/anon-extern-mod-cross-crate-2.rs @@ -15,5 +15,7 @@ extern mod anonexternmod; use anonexternmod::*; pub fn main() { - rust_get_argc(); + unsafe { + rust_get_argc(); + } } diff --git a/src/test/run-pass/anon-extern-mod.rs b/src/test/run-pass/anon-extern-mod.rs index 6e73022fad2..8e03a6393b4 100644 --- a/src/test/run-pass/anon-extern-mod.rs +++ b/src/test/run-pass/anon-extern-mod.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::libc; + #[abi = "cdecl"] #[link_name = "rustrt"] extern { diff --git a/src/test/run-pass/anon-trait-static-method.rs b/src/test/run-pass/anon-trait-static-method.rs index 91bbbf5c0a0..10462fa4abb 100644 --- a/src/test/run-pass/anon-trait-static-method.rs +++ b/src/test/run-pass/anon-trait-static-method.rs @@ -20,5 +20,5 @@ pub impl Foo { pub fn main() { let x = Foo::new(); - io::println(x.x.to_str()); + println(x.x.to_str()); } diff --git a/src/test/run-pass/anon_trait_static_method_exe.rs b/src/test/run-pass/anon_trait_static_method_exe.rs index 1baeca00083..5780a4e97ae 100644 --- a/src/test/run-pass/anon_trait_static_method_exe.rs +++ b/src/test/run-pass/anon_trait_static_method_exe.rs @@ -16,5 +16,5 @@ use anon_trait_static_method_lib::Foo; pub fn main() { let x = Foo::new(); - io::println(x.x.to_str()); + println(x.x.to_str()); } diff --git a/src/test/run-pass/assignability-trait.rs b/src/test/run-pass/assignability-trait.rs index 64e1e20e4ba..5d2341ae42d 100644 --- a/src/test/run-pass/assignability-trait.rs +++ b/src/test/run-pass/assignability-trait.rs @@ -12,6 +12,8 @@ // making method calls, but only if there aren't any matches without // it. +use std::vec; + trait iterable<A> { fn iterate(&self, blk: &fn(x: &A) -> bool) -> bool; } diff --git a/src/test/run-pass/auto-encode.rs b/src/test/run-pass/auto-encode.rs index 0c2f24b5bf7..eebd4d51fb6 100644 --- a/src/test/run-pass/auto-encode.rs +++ b/src/test/run-pass/auto-encode.rs @@ -20,7 +20,9 @@ extern mod extra; use EBReader = extra::ebml::reader; use EBWriter = extra::ebml::writer; use std::cmp::Eq; +use std::cmp; use std::io::Writer; +use std::io; use extra::ebml; use extra::serialize::{Decodable, Encodable}; use extra::time; diff --git a/src/test/run-pass/auto-loop.rs b/src/test/run-pass/auto-loop.rs index dbcbb77efa3..f148c509d4d 100644 --- a/src/test/run-pass/auto-loop.rs +++ b/src/test/run-pass/auto-loop.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + pub fn main() { let mut sum = 0; for vec::each(~[1, 2, 3, 4, 5]) |x| { diff --git a/src/test/run-pass/auto-ref-bounded-ty-param.rs b/src/test/run-pass/auto-ref-bounded-ty-param.rs index 08c936f2bb6..bb01c27fa0d 100644 --- a/src/test/run-pass/auto-ref-bounded-ty-param.rs +++ b/src/test/run-pass/auto-ref-bounded-ty-param.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::io; + trait Foo { fn f(&self); } diff --git a/src/test/run-pass/auto-ref.rs b/src/test/run-pass/auto-ref.rs index ee250b97219..7171b0ee86c 100644 --- a/src/test/run-pass/auto-ref.rs +++ b/src/test/run-pass/auto-ref.rs @@ -18,7 +18,7 @@ trait Stuff { impl Stuff for Foo { fn printme(&self) { - io::println(fmt!("%d", self.x)); + println(fmt!("%d", self.x)); } } diff --git a/src/test/run-pass/bare-static-string.rs b/src/test/run-pass/bare-static-string.rs index 6208a9c3cc3..9b2855d269d 100644 --- a/src/test/run-pass/bare-static-string.rs +++ b/src/test/run-pass/bare-static-string.rs @@ -10,5 +10,5 @@ pub fn main() { let x: &'static str = "foo"; - io::println(x); + println(x); } diff --git a/src/test/run-pass/binops.rs b/src/test/run-pass/binops.rs index a7e910538c9..1c73bf6cc36 100644 --- a/src/test/run-pass/binops.rs +++ b/src/test/run-pass/binops.rs @@ -10,6 +10,8 @@ // Binop corner cases +use std::libc; + fn test_nil() { assert_eq!((), ()); assert!((!(() != ()))); @@ -80,6 +82,8 @@ fn test_ptr() { } mod test { + use std::libc; + #[abi = "cdecl"] #[nolink] pub extern { diff --git a/src/test/run-pass/block-arg-can-be-followed-by-binop.rs b/src/test/run-pass/block-arg-can-be-followed-by-binop.rs index d10bcaa216a..73b436e7476 100644 --- a/src/test/run-pass/block-arg-can-be-followed-by-binop.rs +++ b/src/test/run-pass/block-arg-can-be-followed-by-binop.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + pub fn main() { let v = ~[-1f, 0f, 1f, 2f, 3f]; diff --git a/src/test/run-pass/block-arg-can-be-followed-by-block-arg.rs b/src/test/run-pass/block-arg-can-be-followed-by-block-arg.rs index 194fa297361..7894bf93848 100644 --- a/src/test/run-pass/block-arg-can-be-followed-by-block-arg.rs +++ b/src/test/run-pass/block-arg-can-be-followed-by-block-arg.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + pub fn main() { fn f(i: &fn() -> uint) -> uint { i() } let v = ~[-1f, 0f, 1f, 2f, 3f]; diff --git a/src/test/run-pass/block-arg-can-be-followed-by-call.rs b/src/test/run-pass/block-arg-can-be-followed-by-call.rs index 5243eae30ca..5fb6de19878 100644 --- a/src/test/run-pass/block-arg-can-be-followed-by-call.rs +++ b/src/test/run-pass/block-arg-can-be-followed-by-call.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + pub fn main() { fn f(i: uint) -> uint { i } let v = ~[-1f, 0f, 1f, 2f, 3f]; diff --git a/src/test/run-pass/block-arg-in-parentheses.rs b/src/test/run-pass/block-arg-in-parentheses.rs index ea189de562a..ec211a3a144 100644 --- a/src/test/run-pass/block-arg-in-parentheses.rs +++ b/src/test/run-pass/block-arg-in-parentheses.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + fn w_semi(v: ~[int]) -> int { // the semicolon causes compiler not to // complain about the ignored return value: diff --git a/src/test/run-pass/block-arg.rs b/src/test/run-pass/block-arg.rs index de29ec99167..906a3629f3a 100644 --- a/src/test/run-pass/block-arg.rs +++ b/src/test/run-pass/block-arg.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + // Check usage and precedence of block arguments in expressions: pub fn main() { let v = ~[-1f, 0f, 1f, 2f, 3f]; diff --git a/src/test/run-pass/block-vec-map_zip.rs b/src/test/run-pass/block-vec-map_zip.rs index 4c37000113c..739dbab4d3a 100644 --- a/src/test/run-pass/block-vec-map_zip.rs +++ b/src/test/run-pass/block-vec-map_zip.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern mod extra; +use std::vec; pub fn main() { let v = diff --git a/src/test/run-pass/borrowck-borrow-from-expr-block.rs b/src/test/run-pass/borrowck-borrow-from-expr-block.rs index 5149c87c490..b10f152abe0 100644 --- a/src/test/run-pass/borrowck-borrow-from-expr-block.rs +++ b/src/test/run-pass/borrowck-borrow-from-expr-block.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::ptr; + fn borrow(x: &int, f: &fn(x: &int)) { f(x) } diff --git a/src/test/run-pass/borrowck-mut-uniq.rs b/src/test/run-pass/borrowck-mut-uniq.rs index fa5ae984507..1b43e98cc17 100644 --- a/src/test/run-pass/borrowck-mut-uniq.rs +++ b/src/test/run-pass/borrowck-mut-uniq.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::uint; use std::util; struct Ints {sum: ~int, values: ~[int]} diff --git a/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs b/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs index 4b5d73f597e..d63ebf7d24d 100644 --- a/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs +++ b/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + fn want_slice(v: &[int]) -> int { let mut sum = 0; for vec::each(v) |i| { sum += *i; } diff --git a/src/test/run-pass/borrowck-preserve-box-in-discr.rs b/src/test/run-pass/borrowck-preserve-box-in-discr.rs index 5a94e2f5cd0..8434651dbbf 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-discr.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-discr.rs @@ -10,6 +10,8 @@ // exec-env:RUST_POISON_ON_FREE=1 +use std::ptr; + struct F { f: ~int } pub fn main() { diff --git a/src/test/run-pass/borrowck-preserve-box-in-field.rs b/src/test/run-pass/borrowck-preserve-box-in-field.rs index f86471fd209..93ceeef37b3 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-field.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-field.rs @@ -10,6 +10,8 @@ // exec-env:RUST_POISON_ON_FREE=1 +use std::ptr; + fn borrow(x: &int, f: &fn(x: &int)) { let before = *x; f(x); diff --git a/src/test/run-pass/borrowck-preserve-box-in-pat.rs b/src/test/run-pass/borrowck-preserve-box-in-pat.rs index 17f9dcb627d..1323ac0df5e 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-pat.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-pat.rs @@ -10,6 +10,8 @@ // exec-env:RUST_POISON_ON_FREE=1 +use std::ptr; + struct F { f: ~int } pub fn main() { diff --git a/src/test/run-pass/borrowck-preserve-box-in-uniq.rs b/src/test/run-pass/borrowck-preserve-box-in-uniq.rs index 25bc5c0c982..dcecf77335a 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-uniq.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-uniq.rs @@ -10,6 +10,8 @@ // exec-env:RUST_POISON_ON_FREE=1 +use std::ptr; + fn borrow(x: &int, f: &fn(x: &int)) { let before = *x; f(x); diff --git a/src/test/run-pass/borrowck-preserve-box.rs b/src/test/run-pass/borrowck-preserve-box.rs index 5f4d907e962..8bd8049ea1d 100644 --- a/src/test/run-pass/borrowck-preserve-box.rs +++ b/src/test/run-pass/borrowck-preserve-box.rs @@ -10,6 +10,8 @@ // exec-env:RUST_POISON_ON_FREE=1 +use std::ptr; + fn borrow(x: &int, f: &fn(x: &int)) { let before = *x; f(x); diff --git a/src/test/run-pass/borrowck-preserve-expl-deref.rs b/src/test/run-pass/borrowck-preserve-expl-deref.rs index ac1463caddf..6e683c79875 100644 --- a/src/test/run-pass/borrowck-preserve-expl-deref.rs +++ b/src/test/run-pass/borrowck-preserve-expl-deref.rs @@ -10,6 +10,8 @@ // exec-env:RUST_POISON_ON_FREE=1 +use std::ptr; + fn borrow(x: &int, f: &fn(x: &int)) { let before = *x; f(x); diff --git a/src/test/run-pass/borrowck-wg-borrow-mut-to-imm-3.rs b/src/test/run-pass/borrowck-wg-borrow-mut-to-imm-3.rs index 0699df703c6..212bc62a98a 100644 --- a/src/test/run-pass/borrowck-wg-borrow-mut-to-imm-3.rs +++ b/src/test/run-pass/borrowck-wg-borrow-mut-to-imm-3.rs @@ -5,7 +5,7 @@ struct Wizard { pub impl Wizard { fn cast(&mut self) { for self.spells.each |&spell| { - io::println(spell); + println(spell); } } } diff --git a/src/test/run-pass/borrowck-wg-borrow-mut-to-imm.rs b/src/test/run-pass/borrowck-wg-borrow-mut-to-imm.rs index dea4ec4959b..3b18a8649ee 100644 --- a/src/test/run-pass/borrowck-wg-borrow-mut-to-imm.rs +++ b/src/test/run-pass/borrowck-wg-borrow-mut-to-imm.rs @@ -1,5 +1,5 @@ fn g(x: &Option<int>) { - io::println(x.get().to_str()); + println(x.get().to_str()); } fn f(x: &mut Option<int>) { diff --git a/src/test/run-pass/borrowck-wg-simple.rs b/src/test/run-pass/borrowck-wg-simple.rs index f28b0e4c4ec..c07962e10aa 100644 --- a/src/test/run-pass/borrowck-wg-simple.rs +++ b/src/test/run-pass/borrowck-wg-simple.rs @@ -1,5 +1,5 @@ fn f(x: &int) { - io::println(x.to_str()); + println(x.to_str()); } pub fn main() { diff --git a/src/test/run-pass/boxed-trait-with-vstore.rs b/src/test/run-pass/boxed-trait-with-vstore.rs index 1313a17f81d..1d901d42742 100644 --- a/src/test/run-pass/boxed-trait-with-vstore.rs +++ b/src/test/run-pass/boxed-trait-with-vstore.rs @@ -14,7 +14,7 @@ trait Foo { impl Foo for int { fn foo(@self) { - io::println("Hello world!"); + println("Hello world!"); } } diff --git a/src/test/run-pass/break.rs b/src/test/run-pass/break.rs index da362c8194d..2edb270762c 100644 --- a/src/test/run-pass/break.rs +++ b/src/test/run-pass/break.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + pub fn main() { let mut i = 0; while i < 20 { i += 1; if i == 10 { break; } } diff --git a/src/test/run-pass/c-stack-as-value.rs b/src/test/run-pass/c-stack-as-value.rs index 661aa7a90b1..0a482c745ba 100644 --- a/src/test/run-pass/c-stack-as-value.rs +++ b/src/test/run-pass/c-stack-as-value.rs @@ -8,7 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::libc; + mod rustrt { + use std::libc; + #[abi = "cdecl"] pub extern { pub fn get_task_id() -> libc::intptr_t; diff --git a/src/test/run-pass/c-stack-returning-int64.rs b/src/test/run-pass/c-stack-returning-int64.rs index 647c42cf891..4553257df31 100644 --- a/src/test/run-pass/c-stack-returning-int64.rs +++ b/src/test/run-pass/c-stack-returning-int64.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern mod extra; +use std::str; mod libc { #[abi = "cdecl"] diff --git a/src/test/run-pass/cap-clause-move.rs b/src/test/run-pass/cap-clause-move.rs index 19939650633..aadd6a72494 100644 --- a/src/test/run-pass/cap-clause-move.rs +++ b/src/test/run-pass/cap-clause-move.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::ptr; + pub fn main() { let x = ~1; let y = ptr::to_unsafe_ptr(&(*x)) as uint; diff --git a/src/test/run-pass/capture_nil.rs b/src/test/run-pass/capture_nil.rs index c9a1c031e84..6182ec79a3b 100644 --- a/src/test/run-pass/capture_nil.rs +++ b/src/test/run-pass/capture_nil.rs @@ -25,6 +25,7 @@ // irrelevant). use std::comm::*; +use std::task; fn foo(x: ()) -> Port<()> { let (p, c) = stream::<()>(); diff --git a/src/test/run-pass/cast-region-to-uint.rs b/src/test/run-pass/cast-region-to-uint.rs index 81fa3d6538c..714cbe6bfa1 100644 --- a/src/test/run-pass/cast-region-to-uint.rs +++ b/src/test/run-pass/cast-region-to-uint.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::ptr; + pub fn main() { let x = 3; debug!("&x=%x", ptr::to_uint(&x)); diff --git a/src/test/run-pass/cci_impl_exe.rs b/src/test/run-pass/cci_impl_exe.rs index db25b36aa61..43d9db391d9 100644 --- a/src/test/run-pass/cci_impl_exe.rs +++ b/src/test/run-pass/cci_impl_exe.rs @@ -19,7 +19,7 @@ pub fn main() { //debug!("%?", bt0); do 3u.to(10u) |i| { - io::print(fmt!("%u\n", i)); + print(fmt!("%u\n", i)); //let bt1 = sys::frame_address(); //debug!("%?", bt1); diff --git a/src/test/run-pass/cci_iter_exe.rs b/src/test/run-pass/cci_iter_exe.rs index cb713adcb28..f9a2d786929 100644 --- a/src/test/run-pass/cci_iter_exe.rs +++ b/src/test/run-pass/cci_iter_exe.rs @@ -17,7 +17,7 @@ pub fn main() { //let bt0 = sys::rusti::frame_address(1u32); //debug!("%?", bt0); do cci_iter_lib::iter(~[1, 2, 3]) |i| { - io::print(fmt!("%d", *i)); + print(fmt!("%d", *i)); //assert!(bt0 == sys::rusti::frame_address(2u32)); } } diff --git a/src/test/run-pass/cci_no_inline_exe.rs b/src/test/run-pass/cci_no_inline_exe.rs index a1c2666b2e5..92d0e23589b 100644 --- a/src/test/run-pass/cci_no_inline_exe.rs +++ b/src/test/run-pass/cci_no_inline_exe.rs @@ -23,7 +23,7 @@ pub fn main() { //let bt0 = sys::frame_address(); //debug!("%?", bt0); do iter(~[1u, 2u, 3u]) |i| { - io::print(fmt!("%u\n", i)); + print(fmt!("%u\n", i)); //let bt1 = sys::frame_address(); //debug!("%?", bt1); diff --git a/src/test/run-pass/child-outlives-parent.rs b/src/test/run-pass/child-outlives-parent.rs index de933b53a18..9232547dd8b 100644 --- a/src/test/run-pass/child-outlives-parent.rs +++ b/src/test/run-pass/child-outlives-parent.rs @@ -10,7 +10,7 @@ // Reported as issue #126, child leaks the string. -extern mod extra; +use std::task; fn child2(s: ~str) { } diff --git a/src/test/run-pass/class-cast-to-trait-multiple-types.rs b/src/test/run-pass/class-cast-to-trait-multiple-types.rs index 051c09fac53..c41a8c2b284 100644 --- a/src/test/run-pass/class-cast-to-trait-multiple-types.rs +++ b/src/test/run-pass/class-cast-to-trait-multiple-types.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::uint; + trait noisy { fn speak(&self) -> int; } diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index a73af840fe4..b8ea3bec21a 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -10,8 +10,11 @@ // xfail-fast +use std::cmp; use std::container::{Container, Mutable, Map}; +use std::int; use std::old_iter::BaseIter; +use std::uint; enum cat_type { tuxedo, tabby, tortoiseshell } diff --git a/src/test/run-pass/class-implement-trait-cross-crate.rs b/src/test/run-pass/class-implement-trait-cross-crate.rs index 226dbe535fa..724f9a0f7b1 100644 --- a/src/test/run-pass/class-implement-trait-cross-crate.rs +++ b/src/test/run-pass/class-implement-trait-cross-crate.rs @@ -13,6 +13,8 @@ extern mod cci_class_trait; use cci_class_trait::animals::*; +use std::uint; + struct cat { priv meows: uint, diff --git a/src/test/run-pass/class-implement-traits.rs b/src/test/run-pass/class-implement-traits.rs index 1c0a09d52cf..d8ba7320b95 100644 --- a/src/test/run-pass/class-implement-traits.rs +++ b/src/test/run-pass/class-implement-traits.rs @@ -10,6 +10,8 @@ // xfail-fast +use std::uint; + trait noisy { fn speak(&mut self); } diff --git a/src/test/run-pass/classes-cross-crate.rs b/src/test/run-pass/classes-cross-crate.rs index 6a8a47990b8..0af433bd655 100644 --- a/src/test/run-pass/classes-cross-crate.rs +++ b/src/test/run-pass/classes-cross-crate.rs @@ -13,6 +13,8 @@ extern mod cci_class_4; use cci_class_4::kitties::*; +use std::uint; + pub fn main() { let mut nyan = cat(0u, 2, ~"nyan"); nyan.eat(); diff --git a/src/test/run-pass/classes.rs b/src/test/run-pass/classes.rs index 52346904141..e3f9b651083 100644 --- a/src/test/run-pass/classes.rs +++ b/src/test/run-pass/classes.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::uint; + struct cat { priv meows : uint, diff --git a/src/test/run-pass/cleanup-copy-mode.rs b/src/test/run-pass/cleanup-copy-mode.rs index cb378da13ea..2446e9057c2 100644 --- a/src/test/run-pass/cleanup-copy-mode.rs +++ b/src/test/run-pass/cleanup-copy-mode.rs @@ -9,6 +9,10 @@ // except according to those terms. // xfail-win32 + +use std::result; +use std::task; + fn adder(x: @int, y: @int) -> int { return *x + *y; } fn failer() -> @int { fail!(); } pub fn main() { diff --git a/src/test/run-pass/coerce-reborrow-mut-vec-arg.rs b/src/test/run-pass/coerce-reborrow-mut-vec-arg.rs index 18a28722c70..3d216c1885f 100644 --- a/src/test/run-pass/coerce-reborrow-mut-vec-arg.rs +++ b/src/test/run-pass/coerce-reborrow-mut-vec-arg.rs @@ -1,3 +1,5 @@ +use std::vec; + trait Reverser { fn reverse(&self); } diff --git a/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs b/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs index aa787328c41..d62ed77fdab 100644 --- a/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs +++ b/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs @@ -1,3 +1,5 @@ +use std::vec; + trait Reverser { fn reverse(self); } diff --git a/src/test/run-pass/comm.rs b/src/test/run-pass/comm.rs index c307cf809b6..b0bdfd598fb 100644 --- a/src/test/run-pass/comm.rs +++ b/src/test/run-pass/comm.rs @@ -10,6 +10,7 @@ // except according to those terms. use std::comm::*; +use std::task; pub fn main() { let (p, ch) = stream(); diff --git a/src/test/run-pass/const-cast-ptr-int.rs b/src/test/run-pass/const-cast-ptr-int.rs index 3dc94936304..88ab70f596a 100644 --- a/src/test/run-pass/const-cast-ptr-int.rs +++ b/src/test/run-pass/const-cast-ptr-int.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::ptr; + static a: *u8 = 0 as *u8; pub fn main() { diff --git a/src/test/run-pass/const-cast.rs b/src/test/run-pass/const-cast.rs index 1c8e92b91cd..280fe44c3da 100644 --- a/src/test/run-pass/const-cast.rs +++ b/src/test/run-pass/const-cast.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::libc; + extern fn foo() {} static x: *u8 = foo; diff --git a/src/test/run-pass/const-fields-and-indexing.rs b/src/test/run-pass/const-fields-and-indexing.rs index ccc7b486d1e..990e5e67219 100644 --- a/src/test/run-pass/const-fields-and-indexing.rs +++ b/src/test/run-pass/const-fields-and-indexing.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::io; + static x : [int, ..4] = [1,2,3,4]; static p : int = x[2]; static y : &'static [int] = &[1,2,3,4]; diff --git a/src/test/run-pass/const-rec-and-tup.rs b/src/test/run-pass/const-rec-and-tup.rs index acb7fa2f0f4..31b806bf41a 100644 --- a/src/test/run-pass/const-rec-and-tup.rs +++ b/src/test/run-pass/const-rec-and-tup.rs @@ -21,5 +21,5 @@ static y : AnotherPair = AnotherPair{ x: (0xf0f0f0f0_f0f0f0f0, pub fn main() { let (p, _) = y.x; assert_eq!(p, - 1085102592571150096); - io::println(fmt!("0x%x", p as uint)); + println(fmt!("0x%x", p as uint)); } diff --git a/src/test/run-pass/const-region-ptrs-noncopy.rs b/src/test/run-pass/const-region-ptrs-noncopy.rs index 14397569ad9..3eaf733d784 100644 --- a/src/test/run-pass/const-region-ptrs-noncopy.rs +++ b/src/test/run-pass/const-region-ptrs-noncopy.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::ptr; + type Big = [u64, ..8]; struct Pair<'self> { a: int, b: &'self Big } static x: &'static Big = &([13, 14, 10, 13, 11, 14, 14, 15]); diff --git a/src/test/run-pass/const-region-ptrs.rs b/src/test/run-pass/const-region-ptrs.rs index 12712844c8a..cdc71292ae0 100644 --- a/src/test/run-pass/const-region-ptrs.rs +++ b/src/test/run-pass/const-region-ptrs.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::io; struct Pair<'self> { a: int, b: &'self int } diff --git a/src/test/run-pass/const-str-ptr.rs b/src/test/run-pass/const-str-ptr.rs index 48eb4d6ce59..2f0cd3c611f 100644 --- a/src/test/run-pass/const-str-ptr.rs +++ b/src/test/run-pass/const-str-ptr.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::str; + static a: [u8, ..3] = ['h' as u8, 'i' as u8, 0 as u8]; static c: &'static [u8, ..3] = &a; static b: *u8 = c as *u8; diff --git a/src/test/run-pass/const-struct.rs b/src/test/run-pass/const-struct.rs index 24542f54922..8a93a3e4c1c 100644 --- a/src/test/run-pass/const-struct.rs +++ b/src/test/run-pass/const-struct.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::cmp; +use std::io; struct foo { a: int, b: int, c: int } diff --git a/src/test/run-pass/const-vecs-and-slices.rs b/src/test/run-pass/const-vecs-and-slices.rs index 134ee580425..0aee53a4ed2 100644 --- a/src/test/run-pass/const-vecs-and-slices.rs +++ b/src/test/run-pass/const-vecs-and-slices.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::io; + static x : [int, ..4] = [1,2,3,4]; static y : &'static [int] = &[1,2,3,4]; diff --git a/src/test/run-pass/core-export-f64-sqrt.rs b/src/test/run-pass/core-export-f64-sqrt.rs index 7e00d7efbe2..3a683bc7cb9 100644 --- a/src/test/run-pass/core-export-f64-sqrt.rs +++ b/src/test/run-pass/core-export-f64-sqrt.rs @@ -10,9 +10,12 @@ // Regression test that f64 exports things properly +use std::f64; +use std::float; + pub fn main() { let digits: uint = 10 as uint; - ::std::io::println(float::to_str_digits(f64::sqrt(42.0f64) as float, digits)); + println(float::to_str_digits(f64::sqrt(42.0f64) as float, digits)); } diff --git a/src/test/run-pass/core-run-destroy.rs b/src/test/run-pass/core-run-destroy.rs index a80d9661aa2..81cdb926e5f 100644 --- a/src/test/run-pass/core-run-destroy.rs +++ b/src/test/run-pass/core-run-destroy.rs @@ -15,8 +15,11 @@ // memory, which makes for some *confusing* logs. That's why these are here // instead of in std. -use std::run; +use std::libc; +use std::os; use std::run::*; +use std::run; +use std::str; #[test] fn test_destroy_once() { diff --git a/src/test/run-pass/default-method-simple.rs b/src/test/run-pass/default-method-simple.rs index 3f44f3f1ef8..378852d8150 100644 --- a/src/test/run-pass/default-method-simple.rs +++ b/src/test/run-pass/default-method-simple.rs @@ -12,7 +12,7 @@ trait Foo { fn f(&self) { - io::println("Hello!"); + println("Hello!"); self.g(); } fn g(&self); @@ -24,7 +24,7 @@ struct A { impl Foo for A { fn g(&self) { - io::println("Goodbye!"); + println("Goodbye!"); } } diff --git a/src/test/run-pass/deriving-rand.rs b/src/test/run-pass/deriving-rand.rs index dd4664e7446..193bb1628ef 100644 --- a/src/test/run-pass/deriving-rand.rs +++ b/src/test/run-pass/deriving-rand.rs @@ -9,6 +9,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::rand; + #[deriving(Rand)] struct A; @@ -36,4 +38,4 @@ fn main() { rand::random::<C>(); rand::random::<D>(); } -} \ No newline at end of file +} diff --git a/src/test/run-pass/deriving-to-str.rs b/src/test/run-pass/deriving-to-str.rs index 4b98f9a73c5..fcf0a009d9b 100644 --- a/src/test/run-pass/deriving-to-str.rs +++ b/src/test/run-pass/deriving-to-str.rs @@ -9,6 +9,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::rand; + #[deriving(Rand,ToStr)] struct A; @@ -42,4 +44,4 @@ fn main() { t!(C); t!(D); } -} \ No newline at end of file +} diff --git a/src/test/run-pass/drop-trait-generic.rs b/src/test/run-pass/drop-trait-generic.rs index 6c565604fce..894c387b036 100644 --- a/src/test/run-pass/drop-trait-generic.rs +++ b/src/test/run-pass/drop-trait-generic.rs @@ -15,7 +15,7 @@ struct S<T> { #[unsafe_destructor] impl<T> ::std::ops::Drop for S<T> { fn finalize(&self) { - io::println("bye"); + println("bye"); } } diff --git a/src/test/run-pass/drop-trait.rs b/src/test/run-pass/drop-trait.rs index b516c6f6de4..258a0f88ab5 100644 --- a/src/test/run-pass/drop-trait.rs +++ b/src/test/run-pass/drop-trait.rs @@ -14,7 +14,7 @@ struct Foo { impl Drop for Foo { fn finalize(&self) { - io::println("bye"); + println("bye"); } } diff --git a/src/test/run-pass/early-vtbl-resolution.rs b/src/test/run-pass/early-vtbl-resolution.rs index 58b192e839b..57f4a41fee9 100644 --- a/src/test/run-pass/early-vtbl-resolution.rs +++ b/src/test/run-pass/early-vtbl-resolution.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; trait thing<A> { fn foo(&self) -> Option<A>; diff --git a/src/test/run-pass/empty-tag.rs b/src/test/run-pass/empty-tag.rs index a8822e9a3fc..7b9046318ab 100644 --- a/src/test/run-pass/empty-tag.rs +++ b/src/test/run-pass/empty-tag.rs @@ -10,7 +10,7 @@ enum chan { chan_t, } -impl cmp::Eq for chan { +impl Eq for chan { fn eq(&self, other: &chan) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/enum-alignment.rs b/src/test/run-pass/enum-alignment.rs index cf92515e010..19a6365a2e4 100644 --- a/src/test/run-pass/enum-alignment.rs +++ b/src/test/run-pass/enum-alignment.rs @@ -8,6 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::cast; +use std::ptr; +use std::sys; + fn addr_of<T>(ptr: &T) -> uint { let ptr = ptr::to_unsafe_ptr(ptr); unsafe { ptr as uint } diff --git a/src/test/run-pass/exec-env.rs b/src/test/run-pass/exec-env.rs index 2043a170aba..2437946a1f0 100644 --- a/src/test/run-pass/exec-env.rs +++ b/src/test/run-pass/exec-env.rs @@ -11,6 +11,8 @@ // xfail-fast (exec-env not supported in fast mode) // exec-env:TEST_EXEC_ENV=22 +use std::os; + pub fn main() { assert_eq!(os::getenv(~"TEST_EXEC_ENV"), Some(~"22")); } diff --git a/src/test/run-pass/export-unexported-dep.rs b/src/test/run-pass/export-unexported-dep.rs index ba2a7c6104a..004761479f3 100644 --- a/src/test/run-pass/export-unexported-dep.rs +++ b/src/test/run-pass/export-unexported-dep.rs @@ -15,7 +15,7 @@ mod foo { // not exported enum t { t1, t2, } - impl cmp::Eq for t { + impl Eq for t { fn eq(&self, other: &t) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/expr-if-struct.rs b/src/test/run-pass/expr-if-struct.rs index 13479bb80dc..00e0fe1f582 100644 --- a/src/test/run-pass/expr-if-struct.rs +++ b/src/test/run-pass/expr-if-struct.rs @@ -24,7 +24,7 @@ fn test_rec() { enum mood { happy, sad, } -impl cmp::Eq for mood { +impl Eq for mood { fn eq(&self, other: &mood) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/expr-match-struct.rs b/src/test/run-pass/expr-match-struct.rs index 57483d96e8b..7cfcc38f8dd 100644 --- a/src/test/run-pass/expr-match-struct.rs +++ b/src/test/run-pass/expr-match-struct.rs @@ -23,7 +23,7 @@ fn test_rec() { enum mood { happy, sad, } -impl cmp::Eq for mood { +impl Eq for mood { fn eq(&self, other: &mood) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/extern-call-deep.rs b/src/test/run-pass/extern-call-deep.rs index 6831048bee4..9a50c2ceb02 100644 --- a/src/test/run-pass/extern-call-deep.rs +++ b/src/test/run-pass/extern-call-deep.rs @@ -8,7 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::libc; + mod rustrt { + use std::libc; + pub extern { pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; diff --git a/src/test/run-pass/extern-call-deep2.rs b/src/test/run-pass/extern-call-deep2.rs index 4c5d4218b1f..c4ccf645be4 100644 --- a/src/test/run-pass/extern-call-deep2.rs +++ b/src/test/run-pass/extern-call-deep2.rs @@ -8,7 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::libc; +use std::task; + mod rustrt { + use std::libc; + pub extern { pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; diff --git a/src/test/run-pass/extern-call-scrub.rs b/src/test/run-pass/extern-call-scrub.rs index 5c4d594476f..e0f352a81ef 100644 --- a/src/test/run-pass/extern-call-scrub.rs +++ b/src/test/run-pass/extern-call-scrub.rs @@ -12,7 +12,12 @@ // make sure the stack pointers are maintained properly in both // directions +use std::libc; +use std::task; + mod rustrt { + use std::libc; + pub extern { pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; diff --git a/src/test/run-pass/extern-call.rs b/src/test/run-pass/extern-call.rs index ec335cf8a82..4c36090015b 100644 --- a/src/test/run-pass/extern-call.rs +++ b/src/test/run-pass/extern-call.rs @@ -8,7 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::libc; + mod rustrt { + use std::libc; + pub extern { pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; diff --git a/src/test/run-pass/extern-mod-syntax.rs b/src/test/run-pass/extern-mod-syntax.rs index 0db61fc8cd5..b78f607792b 100644 --- a/src/test/run-pass/extern-mod-syntax.rs +++ b/src/test/run-pass/extern-mod-syntax.rs @@ -14,5 +14,5 @@ extern mod extra; use extra::json::Object; pub fn main() { - io::println("Hello world!"); + println("Hello world!"); } diff --git a/src/test/run-pass/extern-pub.rs b/src/test/run-pass/extern-pub.rs index 1cd709ee91b..29b0457fc05 100644 --- a/src/test/run-pass/extern-pub.rs +++ b/src/test/run-pass/extern-pub.rs @@ -1,3 +1,7 @@ +use std::libc; +use std::sys; +use std::vec; + extern { pub unsafe fn vec_reserve_shared_actual(t: *sys::TypeDesc, v: **vec::raw::VecRepr, diff --git a/src/test/run-pass/extern-stress.rs b/src/test/run-pass/extern-stress.rs index 4257f2b2435..9da4dffffc2 100644 --- a/src/test/run-pass/extern-stress.rs +++ b/src/test/run-pass/extern-stress.rs @@ -11,7 +11,12 @@ // This creates a bunch of yielding tasks that run concurrently // while holding onto C stacks +use std::libc; +use std::task; + mod rustrt { + use std::libc; + pub extern { pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; diff --git a/src/test/run-pass/extern-yield.rs b/src/test/run-pass/extern-yield.rs index b0c44030a17..75e259a38c1 100644 --- a/src/test/run-pass/extern-yield.rs +++ b/src/test/run-pass/extern-yield.rs @@ -8,7 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::libc; +use std::task; + mod rustrt { + use std::libc; + pub extern { pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; diff --git a/src/test/run-pass/fixed_length_vec_glue.rs b/src/test/run-pass/fixed_length_vec_glue.rs index eef898a05ed..d026f041250 100644 --- a/src/test/run-pass/fixed_length_vec_glue.rs +++ b/src/test/run-pass/fixed_length_vec_glue.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::sys; + struct Struc { a: u8, b: [int, ..3], c: int } pub fn main() { diff --git a/src/test/run-pass/float-literal-inference.rs b/src/test/run-pass/float-literal-inference.rs index a5246eef0b0..d2c872c0534 100644 --- a/src/test/run-pass/float-literal-inference.rs +++ b/src/test/run-pass/float-literal-inference.rs @@ -14,9 +14,9 @@ struct S { pub fn main() { let x: f32 = 4.0; - io::println(x.to_str()); + println(x.to_str()); let y: float = 64.0; - io::println(y.to_str()); + println(y.to_str()); let z = S { z: 1.0 }; - io::println(z.z.to_str()); + println(z.z.to_str()); } diff --git a/src/test/run-pass/fn-pattern-expected-type-2.rs b/src/test/run-pass/fn-pattern-expected-type-2.rs index 501bd81d558..ee1e7311024 100644 --- a/src/test/run-pass/fn-pattern-expected-type-2.rs +++ b/src/test/run-pass/fn-pattern-expected-type-2.rs @@ -11,7 +11,7 @@ pub fn main() { let v : &[(int,int)] = &[ (1, 2), (3, 4), (5, 6) ]; for v.each |&(x, y)| { - io::println(y.to_str()); - io::println(x.to_str()); + println(y.to_str()); + println(x.to_str()); } } diff --git a/src/test/run-pass/for-destruct.rs b/src/test/run-pass/for-destruct.rs index bbcb7d58923..4926dbd0086 100644 --- a/src/test/run-pass/for-destruct.rs +++ b/src/test/run-pass/for-destruct.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + struct Pair { x: int, y: int } pub fn main() { diff --git a/src/test/run-pass/foreign-call-no-runtime.rs b/src/test/run-pass/foreign-call-no-runtime.rs index 6ff8b24ab83..e9bf17a037a 100644 --- a/src/test/run-pass/foreign-call-no-runtime.rs +++ b/src/test/run-pass/foreign-call-no-runtime.rs @@ -1,3 +1,5 @@ +use std::cast; +use std::libc; use std::unstable::run_in_bare_thread; extern { diff --git a/src/test/run-pass/foreign-dupe.rs b/src/test/run-pass/foreign-dupe.rs index fe1d5e1200d..200610e0dfe 100644 --- a/src/test/run-pass/foreign-dupe.rs +++ b/src/test/run-pass/foreign-dupe.rs @@ -12,6 +12,8 @@ // calling pin_task and that's having wierd side-effects. mod rustrt1 { + use std::libc; + #[abi = "cdecl"] #[link_name = "rustrt"] pub extern { @@ -20,6 +22,8 @@ mod rustrt1 { } mod rustrt2 { + use std::libc; + #[abi = "cdecl"] #[link_name = "rustrt"] pub extern { diff --git a/src/test/run-pass/foreign-fn-linkname.rs b/src/test/run-pass/foreign-fn-linkname.rs index 15e14e3abe5..27b0c903791 100644 --- a/src/test/run-pass/foreign-fn-linkname.rs +++ b/src/test/run-pass/foreign-fn-linkname.rs @@ -10,6 +10,10 @@ extern mod extra; +use std::libc; +use std::str; +use std::vec; + mod libc { #[nolink] #[abi = "cdecl"] diff --git a/src/test/run-pass/foreign-no-abi.rs b/src/test/run-pass/foreign-no-abi.rs index 67959be866e..76ce5625844 100644 --- a/src/test/run-pass/foreign-no-abi.rs +++ b/src/test/run-pass/foreign-no-abi.rs @@ -11,6 +11,8 @@ // ABI is cdecl by default mod rustrt { + use std::libc; + pub extern { pub fn get_task_id() -> libc::intptr_t; } diff --git a/src/test/run-pass/functional-struct-update.rs b/src/test/run-pass/functional-struct-update.rs index 297b5e78a92..6d95f6b23ab 100644 --- a/src/test/run-pass/functional-struct-update.rs +++ b/src/test/run-pass/functional-struct-update.rs @@ -16,5 +16,5 @@ struct Foo { pub fn main() { let a = Foo { x: 1, y: 2 }; let c = Foo { x: 4, .. a}; - io::println(fmt!("%?", c)); + println(fmt!("%?", c)); } diff --git a/src/test/run-pass/generic-newtype-struct.rs b/src/test/run-pass/generic-newtype-struct.rs index cf4279d67b8..541f9460bc0 100644 --- a/src/test/run-pass/generic-newtype-struct.rs +++ b/src/test/run-pass/generic-newtype-struct.rs @@ -2,5 +2,5 @@ struct S<T>(T); pub fn main() { let s = S(2i); - io::println(s.to_str()); + println(s.to_str()); } diff --git a/src/test/run-pass/getopts_ref.rs b/src/test/run-pass/getopts_ref.rs index 5abef9e5f89..3be685c6389 100644 --- a/src/test/run-pass/getopts_ref.rs +++ b/src/test/run-pass/getopts_ref.rs @@ -19,9 +19,9 @@ pub fn main() { let opts = ~[optopt(~"b")]; match getopts(args, opts) { - result::Ok(ref m) => + Ok(ref m) => assert!(!opt_present(m, "b")), - result::Err(ref f) => fail!(fail_str(copy *f)) + Err(ref f) => fail!(fail_str(copy *f)) }; } diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index fb82e93047d..e7317031332 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -19,8 +19,10 @@ pub fn map(filename: ~str, emit: map_reduce::putter) { emit(filename, ~"1"); } mod map_reduce { - use std::hashmap::HashMap; use std::comm::*; + use std::hashmap::HashMap; + use std::str; + use std::task; pub type putter = @fn(~str, ~str); diff --git a/src/test/run-pass/hello.rs b/src/test/run-pass/hello.rs index 84d525dd0e6..93f6c3db255 100644 --- a/src/test/run-pass/hello.rs +++ b/src/test/run-pass/hello.rs @@ -9,7 +9,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - pub fn main() { - io::println("hello, world"); + println("hello, world"); } diff --git a/src/test/run-pass/impl-privacy-xc-2.rs b/src/test/run-pass/impl-privacy-xc-2.rs index 74d9a34e161..b3e4a4e6711 100644 --- a/src/test/run-pass/impl-privacy-xc-2.rs +++ b/src/test/run-pass/impl-privacy-xc-2.rs @@ -6,5 +6,5 @@ extern mod impl_privacy_xc_2; pub fn main() { let fish1 = impl_privacy_xc_2::Fish { x: 1 }; let fish2 = impl_privacy_xc_2::Fish { x: 2 }; - io::println(if fish1.eq(&fish2) { "yes" } else { "no " }); + println(if fish1.eq(&fish2) { "yes" } else { "no " }); } diff --git a/src/test/run-pass/import-glob-crate.rs b/src/test/run-pass/import-glob-crate.rs index 0e95ee25c42..b036a57e19c 100644 --- a/src/test/run-pass/import-glob-crate.rs +++ b/src/test/run-pass/import-glob-crate.rs @@ -16,6 +16,6 @@ use std::vec::*; pub fn main() { let mut v = from_elem(0u, 0); - v = vec::append(v, ~[4, 2]); + v = append(v, ~[4, 2]); assert_eq!(reversed(v), ~[2, 4]); } diff --git a/src/test/run-pass/instantiable.rs b/src/test/run-pass/instantiable.rs index 2173bae85e1..5415a6ad258 100644 --- a/src/test/run-pass/instantiable.rs +++ b/src/test/run-pass/instantiable.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::ptr; // check that we do not report a type like this as uninstantiable, // even though it would be if the nxt field had type @foo: diff --git a/src/test/run-pass/intrinsics-math.rs b/src/test/run-pass/intrinsics-math.rs index c73df8209e8..b7e449a1117 100644 --- a/src/test/run-pass/intrinsics-math.rs +++ b/src/test/run-pass/intrinsics-math.rs @@ -10,6 +10,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::f64; + mod rusti { #[abi = "rust-intrinsic"] pub extern "rust-intrinsic" { @@ -50,6 +52,9 @@ pub fn main() { unsafe { use rusti::*; + use std::f32; + use std::f64; + assert!((sqrtf32(64f32).approx_eq(&8f32))); assert!((sqrtf64(64f64).approx_eq(&8f64))); diff --git a/src/test/run-pass/invoke-external-foreign.rs b/src/test/run-pass/invoke-external-foreign.rs index 69fce9e541e..15f08ca23e7 100644 --- a/src/test/run-pass/invoke-external-foreign.rs +++ b/src/test/run-pass/invoke-external-foreign.rs @@ -18,5 +18,7 @@ extern mod foreign_lib; pub fn main() { - let foo = foreign_lib::rustrt::rust_get_argc(); + unsafe { + let foo = foreign_lib::rustrt::rust_get_argc(); + } } diff --git a/src/test/run-pass/issue-1251.rs b/src/test/run-pass/issue-1251.rs index c14dd625a8e..886ea53c299 100644 --- a/src/test/run-pass/issue-1251.rs +++ b/src/test/run-pass/issue-1251.rs @@ -11,6 +11,8 @@ #[link(name = "get_task_id")]; mod rustrt { + use std::libc; + pub extern { pub fn get_task_id() -> libc::intptr_t; } diff --git a/src/test/run-pass/issue-1696.rs b/src/test/run-pass/issue-1696.rs index d531217e550..62088e013be 100644 --- a/src/test/run-pass/issue-1696.rs +++ b/src/test/run-pass/issue-1696.rs @@ -11,6 +11,7 @@ // except according to those terms. use std::hashmap::HashMap; +use std::str; pub fn main() { let mut m = HashMap::new(); diff --git a/src/test/run-pass/issue-2611.rs b/src/test/run-pass/issue-2611.rs index 3d4bed4b62f..d7508bca41e 100644 --- a/src/test/run-pass/issue-2611.rs +++ b/src/test/run-pass/issue-2611.rs @@ -9,6 +9,7 @@ // except according to those terms. use std::old_iter::BaseIter; +use std::old_iter; trait FlatMapToVec<A> { fn flat_map_to_vec<B, IB:BaseIter<B>>(&self, op: &fn(&A) -> IB) -> ~[B]; diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 48599b2a538..4dad60225dd 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -14,8 +14,10 @@ use std::util; // tjc: I don't know why pub mod pipes { - use std::util; use std::cast::{forget, transmute}; + use std::cast; + use std::task; + use std::util; pub struct Stuff<T> { state: state, diff --git a/src/test/run-pass/issue-2804.rs b/src/test/run-pass/issue-2804.rs index bb2dbb9fe21..d42d0b5aac0 100644 --- a/src/test/run-pass/issue-2804.rs +++ b/src/test/run-pass/issue-2804.rs @@ -11,8 +11,10 @@ // except according to those terms. extern mod extra; -use std::hashmap::HashMap; + use extra::json; +use std::hashmap::HashMap; +use std::option; enum object { bool_value(bool), diff --git a/src/test/run-pass/issue-2895.rs b/src/test/run-pass/issue-2895.rs index 780ea2dc2c9..e6b3f9f6f35 100644 --- a/src/test/run-pass/issue-2895.rs +++ b/src/test/run-pass/issue-2895.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::sys; + struct Cat { x: int } diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index 1cb8a74e5a4..7670a7eee7c 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -15,6 +15,9 @@ extern mod extra; use std::io::ReaderUtil; +use std::io; +use std::str; +use std::to_str; enum square { bot, diff --git a/src/test/run-pass/issue-2989.rs b/src/test/run-pass/issue-2989.rs index 8ef67840ba3..c13821bddf1 100644 --- a/src/test/run-pass/issue-2989.rs +++ b/src/test/run-pass/issue-2989.rs @@ -10,6 +10,10 @@ extern mod extra; +use std::io; +use std::uint; +use std::vec; + trait methods { fn to_bytes(&self) -> ~[u8]; } diff --git a/src/test/run-pass/issue-3012-2.rs b/src/test/run-pass/issue-3012-2.rs index ef115c5c02c..7d478bbabeb 100644 --- a/src/test/run-pass/issue-3012-2.rs +++ b/src/test/run-pass/issue-3012-2.rs @@ -11,7 +11,9 @@ // xfail-fast // aux-build:issue-3012-1.rs extern mod socketlib; + use socketlib::socket; +use std::libc; pub fn main() { let fd: libc::c_int = 1 as libc::c_int; diff --git a/src/test/run-pass/issue-3168.rs b/src/test/run-pass/issue-3168.rs index d4eb0793dac..fbe66708e47 100644 --- a/src/test/run-pass/issue-3168.rs +++ b/src/test/run-pass/issue-3168.rs @@ -10,6 +10,9 @@ // xfail-fast +use std::comm; +use std::task; + pub fn main() { let (p,c) = comm::stream(); do task::try || { diff --git a/src/test/run-pass/issue-3176.rs b/src/test/run-pass/issue-3176.rs index 54094a0c008..96648a2706b 100644 --- a/src/test/run-pass/issue-3176.rs +++ b/src/test/run-pass/issue-3176.rs @@ -11,6 +11,8 @@ // xfail-fast use std::comm::{Select2, Selectable}; +use std::comm; +use std::task; pub fn main() { let (p,c) = comm::stream(); diff --git a/src/test/run-pass/issue-3211.rs b/src/test/run-pass/issue-3211.rs index 360df325919..c7b0823296c 100644 --- a/src/test/run-pass/issue-3211.rs +++ b/src/test/run-pass/issue-3211.rs @@ -4,5 +4,5 @@ pub fn main() { x += 1; } assert_eq!(x, 4096); - io::println(fmt!("x = %u", x)); + println(fmt!("x = %u", x)); } diff --git a/src/test/run-pass/issue-3389.rs b/src/test/run-pass/issue-3389.rs index 6203f14f10f..d9919b1695d 100644 --- a/src/test/run-pass/issue-3389.rs +++ b/src/test/run-pass/issue-3389.rs @@ -15,7 +15,7 @@ struct trie_node { fn print_str_vector(vector: ~[~str]) { for vector.each() |string| { - io::println(*string); + println(*string); } } diff --git a/src/test/run-pass/issue-3424.rs b/src/test/run-pass/issue-3424.rs index a6eb5097b36..a40d1cf1c6e 100644 --- a/src/test/run-pass/issue-3424.rs +++ b/src/test/run-pass/issue-3424.rs @@ -12,7 +12,10 @@ // rustc --test ignores2.rs && ./ignores2 extern mod extra; + use std::path::{Path}; +use std::path; +use std::result; type rsrc_loader = ~fn(path: &Path) -> result::Result<~str, ~str>; diff --git a/src/test/run-pass/issue-3447.rs b/src/test/run-pass/issue-3447.rs index 191259e5a57..20355238e3e 100644 --- a/src/test/run-pass/issue-3447.rs +++ b/src/test/run-pass/issue-3447.rs @@ -17,7 +17,7 @@ pub impl<'self, T> list<'self, T>{ fn addEnd(&mut self, element: &'self T) { let newList = list { element: element, - next: option::None + next: None }; self.next = Some(@mut newList); @@ -28,7 +28,7 @@ pub fn main() { let s = @"str"; let ls = list { element: &s, - next: option::None + next: None }; - io::println(*ls.element); + println(*ls.element); } diff --git a/src/test/run-pass/issue-3556.rs b/src/test/run-pass/issue-3556.rs index ca67f1dae43..6709ef761a4 100644 --- a/src/test/run-pass/issue-3556.rs +++ b/src/test/run-pass/issue-3556.rs @@ -9,7 +9,9 @@ // except according to those terms. extern mod extra; + use std::io::WriterUtil; +use std::io; enum Token { Text(@~str), diff --git a/src/test/run-pass/issue-3563-3.rs b/src/test/run-pass/issue-3563-3.rs index bfdf4aa053d..10d448b7952 100644 --- a/src/test/run-pass/issue-3563-3.rs +++ b/src/test/run-pass/issue-3563-3.rs @@ -20,7 +20,11 @@ extern mod extra; // Extern mod controls linkage. Use controls the visibility of names to modules that are // already linked in. Using WriterUtil allows us to use the write_line method. +use std::int; use std::io::WriterUtil; +use std::io; +use std::str; +use std::vec; // Represents a position on a canvas. struct Point { diff --git a/src/test/run-pass/issue-3609.rs b/src/test/run-pass/issue-3609.rs index a1aced7b5df..ab62d9c4142 100644 --- a/src/test/run-pass/issue-3609.rs +++ b/src/test/run-pass/issue-3609.rs @@ -1,6 +1,8 @@ extern mod extra; use std::comm::Chan; +use std::task; +use std::uint; type RingBuffer = ~[float]; type SamplesFn = ~fn(samples: &RingBuffer); diff --git a/src/test/run-pass/issue-3702.rs b/src/test/run-pass/issue-3702.rs index 7c2f8cf98cb..7d65d6e984c 100644 --- a/src/test/run-pass/issue-3702.rs +++ b/src/test/run-pass/issue-3702.rs @@ -14,7 +14,7 @@ pub fn main() { } fn to_string(t: @Text) { - io::println(t.to_str()); + println(t.to_str()); } } diff --git a/src/test/run-pass/issue-3753.rs b/src/test/run-pass/issue-3753.rs index 948ff1afd81..825a49e91b0 100644 --- a/src/test/run-pass/issue-3753.rs +++ b/src/test/run-pass/issue-3753.rs @@ -12,6 +12,8 @@ // Issue Name: pub method preceeded by attribute can't be parsed // Abstract: Visibility parsing failed when compiler parsing +use std::float; + struct Point { x: float, y: float @@ -33,5 +35,5 @@ pub impl Shape { pub fn main(){ let s = Circle(Point { x: 1f, y: 2f }, 3f); - io::println(fmt!("%f", s.area(s))); + println(fmt!("%f", s.area(s))); } diff --git a/src/test/run-pass/issue-3847.rs b/src/test/run-pass/issue-3847.rs index 4d1b042661c..b5f41dd1630 100644 --- a/src/test/run-pass/issue-3847.rs +++ b/src/test/run-pass/issue-3847.rs @@ -18,5 +18,5 @@ pub fn main() { buildings::Tower { height: h } => { h } }; - io::println(h.to_str()); + println(h.to_str()); } diff --git a/src/test/run-pass/issue-3888-2.rs b/src/test/run-pass/issue-3888-2.rs index 2992d9a4ac8..60c50624435 100644 --- a/src/test/run-pass/issue-3888-2.rs +++ b/src/test/run-pass/issue-3888-2.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + fn vec_peek<'r, T>(v: &'r [T]) -> &'r [T] { // This doesn't work, and should. // v.slice(1, 5) diff --git a/src/test/run-pass/issue-4333.rs b/src/test/run-pass/issue-4333.rs index 159ba4bb255..98280271bde 100644 --- a/src/test/run-pass/issue-4333.rs +++ b/src/test/run-pass/issue-4333.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::io; + fn main() { let stdout = &io::stdout() as &io::WriterUtil; stdout.write_line("Hello!"); diff --git a/src/test/run-pass/issue-4401.rs b/src/test/run-pass/issue-4401.rs index 73faa9845e7..d0d211c109c 100644 --- a/src/test/run-pass/issue-4401.rs +++ b/src/test/run-pass/issue-4401.rs @@ -4,5 +4,5 @@ pub fn main() { count += 1; } assert_eq!(count, 999_999); - io::println(fmt!("%u", count)); + println(fmt!("%u", count)); } diff --git a/src/test/run-pass/issue-4448.rs b/src/test/run-pass/issue-4448.rs index e1ec65bc10f..212406f9a20 100644 --- a/src/test/run-pass/issue-4448.rs +++ b/src/test/run-pass/issue-4448.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::comm; +use std::task; + pub fn main() { let (port, chan) = comm::stream::<&'static str>(); diff --git a/src/test/run-pass/issue-5572.rs b/src/test/run-pass/issue-5572.rs index d0db5e5cb3c..064413dd93c 100644 --- a/src/test/run-pass/issue-5572.rs +++ b/src/test/run-pass/issue-5572.rs @@ -1,3 +1,3 @@ -fn foo<T: ::cmp::Eq>(t: T) { } +fn foo<T: ::std::cmp::Eq>(t: T) { } fn main() { } diff --git a/src/test/run-pass/issue-5741.rs b/src/test/run-pass/issue-5741.rs index b80e37a425b..d6d09cb0510 100644 --- a/src/test/run-pass/issue-5741.rs +++ b/src/test/run-pass/issue-5741.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::io; + fn main() { return; while io::stdin().read_line() != ~"quit" { }; diff --git a/src/test/run-pass/item-attributes.rs b/src/test/run-pass/item-attributes.rs index 5a1d54c48b5..de11ce2bdf2 100644 --- a/src/test/run-pass/item-attributes.rs +++ b/src/test/run-pass/item-attributes.rs @@ -167,6 +167,8 @@ mod test_other_forms { mod test_foreign_items { pub mod rustrt { + use std::libc; + #[abi = "cdecl"] pub extern { #[attr]; diff --git a/src/test/run-pass/iter-all.rs b/src/test/run-pass/iter-all.rs index b21ddc656c9..b3177d1f84f 100644 --- a/src/test/run-pass/iter-all.rs +++ b/src/test/run-pass/iter-all.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; + fn is_even(x: &uint) -> bool { (*x % 2) == 0 } pub fn main() { diff --git a/src/test/run-pass/iter-any.rs b/src/test/run-pass/iter-any.rs index 657c8d7c624..08a89f8dd22 100644 --- a/src/test/run-pass/iter-any.rs +++ b/src/test/run-pass/iter-any.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; + fn is_even(x: &uint) -> bool { (*x % 2) == 0 } pub fn main() { diff --git a/src/test/run-pass/iter-contains.rs b/src/test/run-pass/iter-contains.rs index 5d5db170efe..5034102c730 100644 --- a/src/test/run-pass/iter-contains.rs +++ b/src/test/run-pass/iter-contains.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; + pub fn main() { assert_eq!([].contains(&22u), false); assert_eq!([1u, 3u].contains(&22u), false); diff --git a/src/test/run-pass/iter-count.rs b/src/test/run-pass/iter-count.rs index 3f717195fbc..3f867e49bd4 100644 --- a/src/test/run-pass/iter-count.rs +++ b/src/test/run-pass/iter-count.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; + pub fn main() { assert_eq!([].count(&22u), 0u); assert_eq!([1u, 3u].count(&22u), 0u); diff --git a/src/test/run-pass/iter-eachi.rs b/src/test/run-pass/iter-eachi.rs index 781f02230c0..0740f2cb8e4 100644 --- a/src/test/run-pass/iter-eachi.rs +++ b/src/test/run-pass/iter-eachi.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; + pub fn main() { let mut c = 0u; for [1u, 2u, 3u, 4u, 5u].eachi |i, v| { diff --git a/src/test/run-pass/iter-filter-to-vec.rs b/src/test/run-pass/iter-filter-to-vec.rs index 0bb7cd1c4dd..2b254765c76 100644 --- a/src/test/run-pass/iter-filter-to-vec.rs +++ b/src/test/run-pass/iter-filter-to-vec.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; + fn is_even(x: &uint) -> bool { (*x % 2) == 0 } pub fn main() { diff --git a/src/test/run-pass/iter-flat-map-to-vec.rs b/src/test/run-pass/iter-flat-map-to-vec.rs index af23905fe76..b0b61aaa816 100644 --- a/src/test/run-pass/iter-flat-map-to-vec.rs +++ b/src/test/run-pass/iter-flat-map-to-vec.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; + fn repeat(x: &uint) -> ~[uint] { ~[*x, *x] } fn incd_if_even(x: &uint) -> Option<uint> { diff --git a/src/test/run-pass/iter-foldl.rs b/src/test/run-pass/iter-foldl.rs index f40abe0c56c..7e5890b3e3a 100644 --- a/src/test/run-pass/iter-foldl.rs +++ b/src/test/run-pass/iter-foldl.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; + fn add(x: &float, y: &uint) -> float { *x + ((*y) as float) } pub fn main() { diff --git a/src/test/run-pass/iter-map-to-vec.rs b/src/test/run-pass/iter-map-to-vec.rs index e9fd68d10f1..706f0c5c150 100644 --- a/src/test/run-pass/iter-map-to-vec.rs +++ b/src/test/run-pass/iter-map-to-vec.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; + fn inc(x: &uint) -> uint { *x + 1 } pub fn main() { diff --git a/src/test/run-pass/iter-min-max.rs b/src/test/run-pass/iter-min-max.rs index 6ce24aedf13..9020976029d 100644 --- a/src/test/run-pass/iter-min-max.rs +++ b/src/test/run-pass/iter-min-max.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; + fn is_even(x: uint) -> bool { (x % 2u) == 0u } pub fn main() { diff --git a/src/test/run-pass/iter-to-vec.rs b/src/test/run-pass/iter-to-vec.rs index b7f2ac77074..317b6089637 100644 --- a/src/test/run-pass/iter-to-vec.rs +++ b/src/test/run-pass/iter-to-vec.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::old_iter; + pub fn main() { assert_eq!([1u, 3u].to_vec(), ~[1u, 3u]); let e: ~[uint] = ~[]; diff --git a/src/test/run-pass/ivec-tag.rs b/src/test/run-pass/ivec-tag.rs index 5b1102a1917..8d87ff40061 100644 --- a/src/test/run-pass/ivec-tag.rs +++ b/src/test/run-pass/ivec-tag.rs @@ -1,4 +1,5 @@ use std::comm::*; +use std::task; fn producer(c: &Chan<~[u8]>) { c.send( diff --git a/src/test/run-pass/let-assignability.rs b/src/test/run-pass/let-assignability.rs index 0afc3ee87e0..2a341474872 100644 --- a/src/test/run-pass/let-assignability.rs +++ b/src/test/run-pass/let-assignability.rs @@ -11,7 +11,7 @@ fn f() { let a = ~"hello"; let b: &str = a; - io::println(b); + println(b); } pub fn main() { diff --git a/src/test/run-pass/linear-for-loop.rs b/src/test/run-pass/linear-for-loop.rs index c9f768d7606..7ab915a9628 100644 --- a/src/test/run-pass/linear-for-loop.rs +++ b/src/test/run-pass/linear-for-loop.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - +use std::str; pub fn main() { let x = ~[1, 2, 3]; diff --git a/src/test/run-pass/log-str.rs b/src/test/run-pass/log-str.rs index d45602d9ed1..fc48f4aea0c 100644 --- a/src/test/run-pass/log-str.rs +++ b/src/test/run-pass/log-str.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::sys; + pub fn main() { let act = sys::log_str(&~[1, 2, 3]); assert_eq!(~"~[1, 2, 3]", act); diff --git a/src/test/run-pass/lots-a-fail.rs b/src/test/run-pass/lots-a-fail.rs index 4eb0cd81bc3..04486a83455 100644 --- a/src/test/run-pass/lots-a-fail.rs +++ b/src/test/run-pass/lots-a-fail.rs @@ -11,6 +11,9 @@ // xfail-win32 leaks extern mod extra; +use std::task; +use std::uint; + fn die() { fail!(); } diff --git a/src/test/run-pass/match-ref-binding-in-guard-3256.rs b/src/test/run-pass/match-ref-binding-in-guard-3256.rs index ed7a6316374..a199a75de56 100644 --- a/src/test/run-pass/match-ref-binding-in-guard-3256.rs +++ b/src/test/run-pass/match-ref-binding-in-guard-3256.rs @@ -8,12 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::unstable; + pub fn main() { - let x = Some(unstable::sync::exclusive(true)); - match x { - Some(ref z) if z.with(|b| *b) => { - do z.with |b| { assert!(*b); } - }, - _ => fail!() + unsafe { + let x = Some(unstable::sync::exclusive(true)); + match x { + Some(ref z) if z.with(|b| *b) => { + do z.with |b| { assert!(*b); } + }, + _ => fail!() + } } } diff --git a/src/test/run-pass/match-with-ret-arm.rs b/src/test/run-pass/match-with-ret-arm.rs index f46521f1d55..fb85064bfde 100644 --- a/src/test/run-pass/match-with-ret-arm.rs +++ b/src/test/run-pass/match-with-ret-arm.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::uint; + pub fn main() { // sometimes we have had trouble finding // the right type for f, as we unified diff --git a/src/test/run-pass/max-min-classes.rs b/src/test/run-pass/max-min-classes.rs index d986d7e676a..87e80568c32 100644 --- a/src/test/run-pass/max-min-classes.rs +++ b/src/test/run-pass/max-min-classes.rs @@ -35,5 +35,5 @@ fn Foo(x: int, y: int) -> Foo { pub fn main() { let foo = Foo(3, 20); - io::println(fmt!("%d %d", foo.sum(), foo.product())); + println(fmt!("%d %d", foo.sum(), foo.product())); } diff --git a/src/test/run-pass/monad.rs b/src/test/run-pass/monad.rs index 6803eb1c6d7..69545238db4 100644 --- a/src/test/run-pass/monad.rs +++ b/src/test/run-pass/monad.rs @@ -10,6 +10,8 @@ // xfail-fast +use std::int; + trait vec_monad<A> { fn bind<B:Copy>(&self, f: &fn(&A) -> ~[B]) -> ~[B]; } diff --git a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs index efbf9302117..eb3c1e4cd27 100644 --- a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs +++ b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs @@ -10,6 +10,8 @@ extern mod extra; +use std::io; + trait Serializer { } diff --git a/src/test/run-pass/morestack5.rs b/src/test/run-pass/morestack5.rs index 492196ed7f0..7f947e332c0 100644 --- a/src/test/run-pass/morestack5.rs +++ b/src/test/run-pass/morestack5.rs @@ -12,6 +12,8 @@ extern mod extra; +use std::task; + fn getbig(i: int) { if i != 0 { getbig(i - 1); diff --git a/src/test/run-pass/morestack6.rs b/src/test/run-pass/morestack6.rs index 79c66ba72b0..1dc8503aeb2 100644 --- a/src/test/run-pass/morestack6.rs +++ b/src/test/run-pass/morestack6.rs @@ -11,7 +11,12 @@ // This test attempts to force the dynamic linker to resolve // external symbols as close to the red zone as possible. +use std::rand; +use std::task; + mod rustrt { + use std::libc; + pub extern { pub fn debug_get_stk_seg() -> *u8; diff --git a/src/test/run-pass/move-3-unique.rs b/src/test/run-pass/move-3-unique.rs index 7b71fc4f86e..1df2e3a382d 100644 --- a/src/test/run-pass/move-3-unique.rs +++ b/src/test/run-pass/move-3-unique.rs @@ -10,6 +10,8 @@ extern mod extra; +use std::uint; + struct Triple { x: int, y: int, z: int } fn test(x: bool, foo: ~Triple) -> int { diff --git a/src/test/run-pass/move-3.rs b/src/test/run-pass/move-3.rs index 64519034ebe..a52f34c54db 100644 --- a/src/test/run-pass/move-3.rs +++ b/src/test/run-pass/move-3.rs @@ -10,6 +10,8 @@ extern mod extra; +use std::uint; + struct Triple { x: int, y: int, z: int } fn test(x: bool, foo: @Triple) -> int { diff --git a/src/test/run-pass/move-self.rs b/src/test/run-pass/move-self.rs index 4ed1faf65b6..61ece52453e 100644 --- a/src/test/run-pass/move-self.rs +++ b/src/test/run-pass/move-self.rs @@ -8,7 +8,7 @@ pub impl S { } fn bar(self) { - io::println(self.x); + println(self.x); } } diff --git a/src/test/run-pass/moves-based-on-type-capture-clause.rs b/src/test/run-pass/moves-based-on-type-capture-clause.rs index 26d4773d961..349be13e323 100644 --- a/src/test/run-pass/moves-based-on-type-capture-clause.rs +++ b/src/test/run-pass/moves-based-on-type-capture-clause.rs @@ -1,6 +1,8 @@ +use std::task; + pub fn main() { let x = ~"Hello world!"; do task::spawn { - io::println(x); + println(x); } } diff --git a/src/test/run-pass/multibyte.rs b/src/test/run-pass/multibyte.rs index 7cb959b3437..417662b65c6 100644 --- a/src/test/run-pass/multibyte.rs +++ b/src/test/run-pass/multibyte.rs @@ -10,5 +10,5 @@ // Test that multibyte characters don't crash the compiler fn main() { - io::println("마이너스 사인이 없으면"); + println("마이너스 사인이 없으면"); } diff --git a/src/test/run-pass/mutability-inherits-through-fixed-length-vec.rs b/src/test/run-pass/mutability-inherits-through-fixed-length-vec.rs index aef857f36ee..0b4f92f1d7c 100644 --- a/src/test/run-pass/mutability-inherits-through-fixed-length-vec.rs +++ b/src/test/run-pass/mutability-inherits-through-fixed-length-vec.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + fn test1() { let mut ints = [0, ..32]; ints[0] += 1; diff --git a/src/test/run-pass/mutable-alias-vec.rs b/src/test/run-pass/mutable-alias-vec.rs index b058df7fc7a..91f4fdb01f6 100644 --- a/src/test/run-pass/mutable-alias-vec.rs +++ b/src/test/run-pass/mutable-alias-vec.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - // -*- rust -*- extern mod extra; +use std::vec; + fn grow(v: &mut ~[int]) { *v += ~[1]; } pub fn main() { diff --git a/src/test/run-pass/new-impl-syntax.rs b/src/test/run-pass/new-impl-syntax.rs index 2603353f0cf..71c13ecb9a3 100644 --- a/src/test/run-pass/new-impl-syntax.rs +++ b/src/test/run-pass/new-impl-syntax.rs @@ -20,6 +20,6 @@ impl<T:ToStr> ToStr for PolymorphicThingy<T> { } pub fn main() { - io::println(Thingy { x: 1, y: 2 }.to_str()); - io::println(PolymorphicThingy { x: Thingy { x: 1, y: 2 } }.to_str()); + println(Thingy { x: 1, y: 2 }.to_str()); + println(PolymorphicThingy { x: Thingy { x: 1, y: 2 } }.to_str()); } diff --git a/src/test/run-pass/newtype.rs b/src/test/run-pass/newtype.rs index 6d36357ccfa..d26210e9a4c 100644 --- a/src/test/run-pass/newtype.rs +++ b/src/test/run-pass/newtype.rs @@ -16,6 +16,6 @@ fn compute(i: mytype) -> int { return i.val + 20; } pub fn main() { let myval = mytype(Mytype{compute: compute, val: 30}); - io::println(fmt!("%d", compute(myval))); + println(fmt!("%d", compute(myval))); assert_eq!((myval.compute)(myval), 50); } diff --git a/src/test/run-pass/nullable-pointer-size.rs b/src/test/run-pass/nullable-pointer-size.rs index 1e8ddc2905e..704fd4eafba 100644 --- a/src/test/run-pass/nullable-pointer-size.rs +++ b/src/test/run-pass/nullable-pointer-size.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::sys; + enum E<T> { Thing(int, T), Nothing((), ((), ()), [i8, ..0]) } struct S<T>(int, T); diff --git a/src/test/run-pass/operator-overloading.rs b/src/test/run-pass/operator-overloading.rs index b54e3188dae..e75af5729d5 100644 --- a/src/test/run-pass/operator-overloading.rs +++ b/src/test/run-pass/operator-overloading.rs @@ -10,6 +10,9 @@ // xfail-fast +use std::cmp; +use std::ops; + struct Point { x: int, y: int diff --git a/src/test/run-pass/option-ext.rs b/src/test/run-pass/option-ext.rs index 63114da9d9d..7355bde61f3 100644 --- a/src/test/run-pass/option-ext.rs +++ b/src/test/run-pass/option-ext.rs @@ -8,11 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::str; + pub fn main() { let thing = ~"{{ f }}"; let f = str::find_str(thing, ~"{{"); if f.is_none() { - io::println(~"None!"); + println(~"None!"); } } diff --git a/src/test/run-pass/packed-struct-generic-layout.rs b/src/test/run-pass/packed-struct-generic-layout.rs index fd6e3b670f5..18b3cf2f91e 100644 --- a/src/test/run-pass/packed-struct-generic-layout.rs +++ b/src/test/run-pass/packed-struct-generic-layout.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::cast; + #[packed] struct S<T, S> { a: T, diff --git a/src/test/run-pass/packed-struct-generic-size.rs b/src/test/run-pass/packed-struct-generic-size.rs index a5c4d5385a2..98e922c3288 100644 --- a/src/test/run-pass/packed-struct-generic-size.rs +++ b/src/test/run-pass/packed-struct-generic-size.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::sys; + #[packed] struct S<T, S> { a: T, diff --git a/src/test/run-pass/packed-struct-layout.rs b/src/test/run-pass/packed-struct-layout.rs index 8d27e55e191..ea51bbcea32 100644 --- a/src/test/run-pass/packed-struct-layout.rs +++ b/src/test/run-pass/packed-struct-layout.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::cast; + #[packed] struct S4 { a: u8, diff --git a/src/test/run-pass/packed-struct-size-xc.rs b/src/test/run-pass/packed-struct-size-xc.rs index ddfc2b17aa7..19f6046c7d6 100644 --- a/src/test/run-pass/packed-struct-size-xc.rs +++ b/src/test/run-pass/packed-struct-size-xc.rs @@ -3,6 +3,8 @@ extern mod packed; +use std::sys; + fn main() { assert_eq!(sys::size_of::<packed::S>(), 5); } diff --git a/src/test/run-pass/packed-struct-size.rs b/src/test/run-pass/packed-struct-size.rs index 372fe3d37f6..6dcb1f04a4d 100644 --- a/src/test/run-pass/packed-struct-size.rs +++ b/src/test/run-pass/packed-struct-size.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::sys; + #[packed] struct S4 { a: u8, diff --git a/src/test/run-pass/packed-struct-vec.rs b/src/test/run-pass/packed-struct-vec.rs index b1ac29b7721..1f3d4c26bd2 100644 --- a/src/test/run-pass/packed-struct-vec.rs +++ b/src/test/run-pass/packed-struct-vec.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::sys; +use std::uint; + #[packed] #[deriving(Eq)] struct Foo { diff --git a/src/test/run-pass/packed-tuple-struct-layout.rs b/src/test/run-pass/packed-tuple-struct-layout.rs index 9c2fe621a32..3691f475098 100644 --- a/src/test/run-pass/packed-tuple-struct-layout.rs +++ b/src/test/run-pass/packed-tuple-struct-layout.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::cast; + #[packed] struct S4(u8,[u8, .. 3]); diff --git a/src/test/run-pass/packed-tuple-struct-size.rs b/src/test/run-pass/packed-tuple-struct-size.rs index 23faa2eb0ad..c8f2dda61db 100644 --- a/src/test/run-pass/packed-tuple-struct-size.rs +++ b/src/test/run-pass/packed-tuple-struct-size.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::sys; + #[packed] struct S4(u8,[u8, .. 3]); diff --git a/src/test/run-pass/pattern-bound-var-in-for-each.rs b/src/test/run-pass/pattern-bound-var-in-for-each.rs index a2630c39803..5a0f9ed6eb4 100644 --- a/src/test/run-pass/pattern-bound-var-in-for-each.rs +++ b/src/test/run-pass/pattern-bound-var-in-for-each.rs @@ -12,6 +12,8 @@ // pattern-bound var is an upvar (when translating // the for-each body) +use std::uint; + fn foo(src: uint) { match Some(src) { diff --git a/src/test/run-pass/pattern-in-closure.rs b/src/test/run-pass/pattern-in-closure.rs index 08c749235c2..bee3583c6a4 100644 --- a/src/test/run-pass/pattern-in-closure.rs +++ b/src/test/run-pass/pattern-in-closure.rs @@ -14,8 +14,8 @@ struct Foo { } pub fn main() { - let f = |(x, _): (int, int)| io::println((x + 1).to_str()); - let g = |Foo { x: x, y: y }: Foo| io::println((x + 1).to_str()); + let f = |(x, _): (int, int)| println((x + 1).to_str()); + let g = |Foo { x: x, y: y }: Foo| println((x + 1).to_str()); f((2, 3)); g(Foo { x: 1, y: 2 }); } diff --git a/src/test/run-pass/pipe-bank-proto.rs b/src/test/run-pass/pipe-bank-proto.rs index 83031b46704..d723fa32209 100644 --- a/src/test/run-pass/pipe-bank-proto.rs +++ b/src/test/run-pass/pipe-bank-proto.rs @@ -17,6 +17,7 @@ use std::pipes; use std::pipes::try_recv; +use std::ptr; pub type username = ~str; pub type password = ~str; @@ -81,7 +82,7 @@ fn client_follow(bank: bank::client::login) { let bank = client::withdrawal(bank, 50.00); switch(bank, follow! ( money(m) -> _next { - io::println(~"Yay! I got money!"); + println(~"Yay! I got money!"); } insufficient_funds -> _next { fail!("someone stole my money") @@ -105,7 +106,7 @@ fn bank_client(bank: bank::client::login) { let bank = client::withdrawal(bank, 50.00); match try_recv(bank) { Some(money(*)) => { - io::println(~"Yay! I got money!"); + println(~"Yay! I got money!"); } Some(insufficient_funds(_)) => { fail!("someone stole my money") diff --git a/src/test/run-pass/pipe-detect-term.rs b/src/test/run-pass/pipe-detect-term.rs index d922eef5dbb..ae846217318 100644 --- a/src/test/run-pass/pipe-detect-term.rs +++ b/src/test/run-pass/pipe-detect-term.rs @@ -20,6 +20,7 @@ use extra::uv; use std::cell::Cell; use std::pipes::{try_recv, recv}; +use std::task; proto! oneshot ( waiting:send { diff --git a/src/test/run-pass/pipe-pingpong-bounded.rs b/src/test/run-pass/pipe-pingpong-bounded.rs index b4c92dc0614..d36289f33c8 100644 --- a/src/test/run-pass/pipe-pingpong-bounded.rs +++ b/src/test/run-pass/pipe-pingpong-bounded.rs @@ -15,6 +15,7 @@ // protocols. use std::cell::Cell; +use std::task; // This was generated initially by the pipe compiler, but it's been // modified in hopefully straightforward ways. diff --git a/src/test/run-pass/pipe-pingpong-proto.rs b/src/test/run-pass/pipe-pingpong-proto.rs index 95502b14c53..18cb4059307 100644 --- a/src/test/run-pass/pipe-pingpong-proto.rs +++ b/src/test/run-pass/pipe-pingpong-proto.rs @@ -14,6 +14,7 @@ use std::cell::Cell; use std::option; +use std::task; proto! pingpong ( ping:send { diff --git a/src/test/run-pass/pipe-select.rs b/src/test/run-pass/pipe-select.rs index a386c3a2e05..309092b14b5 100644 --- a/src/test/run-pass/pipe-select.rs +++ b/src/test/run-pass/pipe-select.rs @@ -18,8 +18,9 @@ use extra::timer::sleep; use extra::uv; use std::cell::Cell; -use std::pipes; use std::pipes::*; +use std::pipes; +use std::task; proto! oneshot ( waiting:send { @@ -110,8 +111,8 @@ fn test_select2() { stream::client::send(ac, 42); match pipes::select2(ap, bp) { - either::Left(*) => { } - either::Right(*) => { fail!() } + Left(*) => { } + Right(*) => { fail!() } } stream::client::send(bc, ~"abc"); @@ -124,8 +125,8 @@ fn test_select2() { stream::client::send(bc, ~"abc"); match pipes::select2(ap, bp) { - either::Left(*) => { fail!() } - either::Right(*) => { } + Left(*) => { fail!() } + Right(*) => { } } stream::client::send(ac, 42); diff --git a/src/test/run-pass/pipe-sleep.rs b/src/test/run-pass/pipe-sleep.rs index 674ad5f3405..97fefde6cff 100644 --- a/src/test/run-pass/pipe-sleep.rs +++ b/src/test/run-pass/pipe-sleep.rs @@ -11,11 +11,13 @@ // except according to those terms. extern mod extra; + use extra::timer::sleep; use extra::uv; use std::cell::Cell; -use std::pipes; use std::pipes::*; +use std::pipes; +use std::task; proto! oneshot ( waiting:send { diff --git a/src/test/run-pass/placement-new-arena.rs b/src/test/run-pass/placement-new-arena.rs index 1dafbca22f7..839f40fe67f 100644 --- a/src/test/run-pass/placement-new-arena.rs +++ b/src/test/run-pass/placement-new-arena.rs @@ -17,6 +17,6 @@ pub fn main() { let mut arena = arena::Arena(); let p = &mut arena; let x = p.alloc(|| 4u); - io::print(fmt!("%u", *x)); + print(fmt!("%u", *x)); assert_eq!(*x, 4u); } diff --git a/src/test/run-pass/platform_thread.rs b/src/test/run-pass/platform_thread.rs index 774f2470b3c..ea39d00edf7 100644 --- a/src/test/run-pass/platform_thread.rs +++ b/src/test/run-pass/platform_thread.rs @@ -12,6 +12,8 @@ // The OS main scheduler should continue to be available and not terminate // while it is not in use. +use std::task; + pub fn main() { run(100); } diff --git a/src/test/run-pass/private-method.rs b/src/test/run-pass/private-method.rs index 1fab77cb5c8..2b811a69db0 100644 --- a/src/test/run-pass/private-method.rs +++ b/src/test/run-pass/private-method.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::uint; + struct cat { priv meows : uint, diff --git a/src/test/run-pass/rcvr-borrowed-to-slice.rs b/src/test/run-pass/rcvr-borrowed-to-slice.rs index 188dca2f039..5eaf12f6a51 100644 --- a/src/test/run-pass/rcvr-borrowed-to-slice.rs +++ b/src/test/run-pass/rcvr-borrowed-to-slice.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + trait sum { fn sum(self) -> int; } diff --git a/src/test/run-pass/rec-align-u32.rs b/src/test/run-pass/rec-align-u32.rs index 202f6a4ac64..475b9153fdc 100644 --- a/src/test/run-pass/rec-align-u32.rs +++ b/src/test/run-pass/rec-align-u32.rs @@ -10,6 +10,8 @@ // Issue #2303 +use std::sys; + mod rusti { #[abi = "rust-intrinsic"] pub extern "rust-intrinsic" { diff --git a/src/test/run-pass/rec-align-u64.rs b/src/test/run-pass/rec-align-u64.rs index 49092c26c95..8c67b971243 100644 --- a/src/test/run-pass/rec-align-u64.rs +++ b/src/test/run-pass/rec-align-u64.rs @@ -10,6 +10,8 @@ // Issue #2303 +use std::sys; + mod rusti { #[abi = "rust-intrinsic"] pub extern "rust-intrinsic" { diff --git a/src/test/run-pass/reflect-visit-data.rs b/src/test/run-pass/reflect-visit-data.rs index 9663beb279e..387e21fb9d6 100644 --- a/src/test/run-pass/reflect-visit-data.rs +++ b/src/test/run-pass/reflect-visit-data.rs @@ -11,7 +11,10 @@ // xfail-fast use std::bool; +use std::int; use std::libc::c_void; +use std::ptr; +use std::sys; use std::vec::UnboxedVecRepr; use intrinsic::{TyDesc, get_tydesc, visit_tydesc, TyVisitor, Opaque}; @@ -654,7 +657,7 @@ pub fn main() { visit_tydesc(td, v); for (u.vals.clone()).each |s| { - io::println(fmt!("val: %s", *s)); + println(fmt!("val: %s", *s)); } error!("%?", u.vals.clone()); assert!(u.vals == ~[ diff --git a/src/test/run-pass/regions-infer-borrow-scope-addr-of.rs b/src/test/run-pass/regions-infer-borrow-scope-addr-of.rs index 33d147c22b6..702b64881ab 100644 --- a/src/test/run-pass/regions-infer-borrow-scope-addr-of.rs +++ b/src/test/run-pass/regions-infer-borrow-scope-addr-of.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::uint; use std::util; pub fn main() { diff --git a/src/test/run-pass/regions-mock-trans.rs b/src/test/run-pass/regions-mock-trans.rs index 0ea6f852a89..56000d7471d 100644 --- a/src/test/run-pass/regions-mock-trans.rs +++ b/src/test/run-pass/regions-mock-trans.rs @@ -8,6 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::cast; +use std::libc; +use std::sys; + struct arena(()); struct Bcx<'self> { diff --git a/src/test/run-pass/resource-cycle.rs b/src/test/run-pass/resource-cycle.rs index f498553834a..3ce5ea66781 100644 --- a/src/test/run-pass/resource-cycle.rs +++ b/src/test/run-pass/resource-cycle.rs @@ -10,6 +10,8 @@ // Don't leak the unique pointers +use std::cast; + struct r { v: *int, } diff --git a/src/test/run-pass/resource-cycle2.rs b/src/test/run-pass/resource-cycle2.rs index 2a59d4d2190..0f031424ad4 100644 --- a/src/test/run-pass/resource-cycle2.rs +++ b/src/test/run-pass/resource-cycle2.rs @@ -10,6 +10,8 @@ // Don't leak the unique pointers +use std::cast; + struct U { a: int, b: int, diff --git a/src/test/run-pass/resource-cycle3.rs b/src/test/run-pass/resource-cycle3.rs index ef713724778..f3ca932778a 100644 --- a/src/test/run-pass/resource-cycle3.rs +++ b/src/test/run-pass/resource-cycle3.rs @@ -12,6 +12,8 @@ // Don't leak the unique pointers +use std::cast; + struct U { a: int, b: int, diff --git a/src/test/run-pass/ret-break-cont-in-block.rs b/src/test/run-pass/ret-break-cont-in-block.rs index 9a547bd4bdf..d9d4b332f5f 100644 --- a/src/test/run-pass/ret-break-cont-in-block.rs +++ b/src/test/run-pass/ret-break-cont-in-block.rs @@ -11,6 +11,7 @@ // xfail-fast use std::cmp::Eq; +use std::vec; fn iter<T>(v: ~[T], it: &fn(&T) -> bool) -> bool { let mut i = 0u, l = v.len(); diff --git a/src/test/run-pass/rt-sched-1.rs b/src/test/run-pass/rt-sched-1.rs index a60b24987c8..d1767235a2b 100644 --- a/src/test/run-pass/rt-sched-1.rs +++ b/src/test/run-pass/rt-sched-1.rs @@ -10,7 +10,9 @@ // Tests of the runtime's scheduler interface +use std::cast; use std::comm::*; +use std::libc; pub type sched_id = int; pub type task_id = *libc::c_void; @@ -21,6 +23,8 @@ pub type closure = *libc::c_void; mod rustrt { use super::{closure, sched_id, task, task_id}; + use std::libc; + pub extern { pub fn rust_new_sched(num_threads: libc::uintptr_t) -> sched_id; pub fn rust_get_sched_id() -> sched_id; diff --git a/src/test/run-pass/send-iloop.rs b/src/test/run-pass/send-iloop.rs index ed0a5263035..4977082e7ed 100644 --- a/src/test/run-pass/send-iloop.rs +++ b/src/test/run-pass/send-iloop.rs @@ -11,6 +11,10 @@ // xfail-win32 extern mod extra; +use std::comm; +use std::task; +use std::uint; + fn die() { fail!(); } diff --git a/src/test/run-pass/send-resource.rs b/src/test/run-pass/send-resource.rs index 17789e0b509..a2cee0082b5 100644 --- a/src/test/run-pass/send-resource.rs +++ b/src/test/run-pass/send-resource.rs @@ -9,6 +9,7 @@ // except according to those terms. use std::comm::*; +use std::task; struct test { f: int, diff --git a/src/test/run-pass/sendable-class.rs b/src/test/run-pass/sendable-class.rs index 8ef0173dbd3..6b262966277 100644 --- a/src/test/run-pass/sendable-class.rs +++ b/src/test/run-pass/sendable-class.rs @@ -10,6 +10,8 @@ // Test that a class with only sendable fields can be sent +use std::comm; + struct foo { i: int, j: char, diff --git a/src/test/run-pass/sendfn-generic-fn.rs b/src/test/run-pass/sendfn-generic-fn.rs index 2351540baa9..31a1e7bded7 100644 --- a/src/test/run-pass/sendfn-generic-fn.rs +++ b/src/test/run-pass/sendfn-generic-fn.rs @@ -10,6 +10,8 @@ // xfail-fast +use std::task; + pub fn main() { test05(); } struct Pair<A,B> { a: A, b: B } diff --git a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs index 19e85319927..d9f491297ea 100644 --- a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs +++ b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs @@ -9,6 +9,7 @@ // except according to those terms. use std::cell::Cell; +use std::task; pub fn main() { test05(); } diff --git a/src/test/run-pass/shebang.rs b/src/test/run-pass/shebang.rs index f47faca52c0..94760ce36b5 100644 --- a/src/test/run-pass/shebang.rs +++ b/src/test/run-pass/shebang.rs @@ -11,4 +11,4 @@ // pp-exact -pub fn main() { io::println("Hello World"); } +pub fn main() { println("Hello World"); } diff --git a/src/test/run-pass/spawn-fn.rs b/src/test/run-pass/spawn-fn.rs index 37501a61066..e3e39b9d5b5 100644 --- a/src/test/run-pass/spawn-fn.rs +++ b/src/test/run-pass/spawn-fn.rs @@ -9,6 +9,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::task; fn x(s: ~str, n: int) { debug!(s); diff --git a/src/test/run-pass/spawn-types.rs b/src/test/run-pass/spawn-types.rs index 58b7b8c09a5..f448d74c4bd 100644 --- a/src/test/run-pass/spawn-types.rs +++ b/src/test/run-pass/spawn-types.rs @@ -15,6 +15,7 @@ */ use std::comm::*; +use std::task; type ctx = Chan<int>; diff --git a/src/test/run-pass/spawn.rs b/src/test/run-pass/spawn.rs index fef00549fa7..dff73aa7b8e 100644 --- a/src/test/run-pass/spawn.rs +++ b/src/test/run-pass/spawn.rs @@ -9,9 +9,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - extern mod extra; +use std::task; pub fn main() { task::spawn(|| child(10) ); diff --git a/src/test/run-pass/spawn2.rs b/src/test/run-pass/spawn2.rs index cb35f0828f2..61ed7053456 100644 --- a/src/test/run-pass/spawn2.rs +++ b/src/test/run-pass/spawn2.rs @@ -9,6 +9,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::task; + pub fn main() { task::spawn(|| child((10, 20, 30, 40, 50, 60, 70, 80, 90)) ); } fn child(args: (int, int, int, int, int, int, int, int, int)) { diff --git a/src/test/run-pass/stable-addr-of.rs b/src/test/run-pass/stable-addr-of.rs index 9008e9452db..dc68777e033 100644 --- a/src/test/run-pass/stable-addr-of.rs +++ b/src/test/run-pass/stable-addr-of.rs @@ -10,6 +10,8 @@ // Issue #2040 +use std::ptr; + pub fn main() { let foo = 1; assert_eq!(ptr::to_unsafe_ptr(&foo), ptr::to_unsafe_ptr(&foo)); diff --git a/src/test/run-pass/stat.rs b/src/test/run-pass/stat.rs index f9216135038..a3774d58ee7 100644 --- a/src/test/run-pass/stat.rs +++ b/src/test/run-pass/stat.rs @@ -11,8 +11,12 @@ // xfail-fast extern mod extra; -use std::io::WriterUtil; + use extra::tempfile; +use std::io::WriterUtil; +use std::io; +use std::os; +use std::uint; pub fn main() { let dir = tempfile::mkdtemp(&Path("."), "").unwrap(); diff --git a/src/test/run-pass/static-impl.rs b/src/test/run-pass/static-impl.rs index e96ab30f037..46457f667ae 100644 --- a/src/test/run-pass/static-impl.rs +++ b/src/test/run-pass/static-impl.rs @@ -10,6 +10,9 @@ // xfail-fast +use std::uint; +use std::vec; + pub trait plus { fn plus(&self) -> int; } diff --git a/src/test/run-pass/static-method-test.rs b/src/test/run-pass/static-method-test.rs index 3ae8768e41e..4dde143f686 100644 --- a/src/test/run-pass/static-method-test.rs +++ b/src/test/run-pass/static-method-test.rs @@ -10,6 +10,10 @@ // xfail-fast +use std::at_vec; +use std::uint; +use std::vec; + // A trait for objects that can be used to do an if-then-else // (No actual need for this to be static, but it is a simple test.) trait bool_like { diff --git a/src/test/run-pass/static-method-xcrate.rs b/src/test/run-pass/static-method-xcrate.rs index 946c86ab298..6697daa28b6 100644 --- a/src/test/run-pass/static-method-xcrate.rs +++ b/src/test/run-pass/static-method-xcrate.rs @@ -12,6 +12,7 @@ // aux-build:static-methods-crate.rs extern mod static_methods_crate; + use static_methods_crate::read; pub fn main() { diff --git a/src/test/run-pass/string-self-append.rs b/src/test/run-pass/string-self-append.rs index 6fe383a64a2..f02600bb137 100644 --- a/src/test/run-pass/string-self-append.rs +++ b/src/test/run-pass/string-self-append.rs @@ -10,6 +10,8 @@ extern mod extra; +use std::str; + pub fn main() { // Make sure we properly handle repeated self-appends. let mut a: ~str = ~"A"; diff --git a/src/test/run-pass/struct-order-of-eval-1.rs b/src/test/run-pass/struct-order-of-eval-1.rs index 884459cf069..cfa0401e5b9 100644 --- a/src/test/run-pass/struct-order-of-eval-1.rs +++ b/src/test/run-pass/struct-order-of-eval-1.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::str; + struct S { f0: ~str, f1: int } pub fn main() { diff --git a/src/test/run-pass/struct-order-of-eval-2.rs b/src/test/run-pass/struct-order-of-eval-2.rs index 419c4ac3942..f58e5bab3fe 100644 --- a/src/test/run-pass/struct-order-of-eval-2.rs +++ b/src/test/run-pass/struct-order-of-eval-2.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::str; + struct S { f0: ~str, f1: ~str } pub fn main() { diff --git a/src/test/run-pass/struct-pattern-matching.rs b/src/test/run-pass/struct-pattern-matching.rs index 1bda2d2412d..68fa1373975 100644 --- a/src/test/run-pass/struct-pattern-matching.rs +++ b/src/test/run-pass/struct-pattern-matching.rs @@ -16,6 +16,6 @@ struct Foo { pub fn main() { let a = Foo { x: 1, y: 2 }; match a { - Foo { x: x, y: y } => io::println(fmt!("yes, %d, %d", x, y)) + Foo { x: x, y: y } => println(fmt!("yes, %d, %d", x, y)) } } diff --git a/src/test/run-pass/structured-compare.rs b/src/test/run-pass/structured-compare.rs index d03bc594bb4..c67a72e90c9 100644 --- a/src/test/run-pass/structured-compare.rs +++ b/src/test/run-pass/structured-compare.rs @@ -12,7 +12,7 @@ enum foo { large, small, } -impl cmp::Eq for foo { +impl Eq for foo { fn eq(&self, other: &foo) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/supported-cast.rs b/src/test/run-pass/supported-cast.rs index 791f493b5cc..36e41242f8f 100644 --- a/src/test/run-pass/supported-cast.rs +++ b/src/test/run-pass/supported-cast.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::libc; + pub fn main() { let f = 1 as *libc::FILE; debug!(f as int); diff --git a/src/test/run-pass/swap-2.rs b/src/test/run-pass/swap-2.rs index 52092b994f9..cf3a465d812 100644 --- a/src/test/run-pass/swap-2.rs +++ b/src/test/run-pass/swap-2.rs @@ -9,6 +9,7 @@ // except according to those terms. use std::util; +use std::vec; pub fn main() { let mut a: ~[int] = ~[0, 1, 2, 3, 4, 5, 6]; diff --git a/src/test/run-pass/swap-overlapping.rs b/src/test/run-pass/swap-overlapping.rs index 1f1b121d362..d1d84137334 100644 --- a/src/test/run-pass/swap-overlapping.rs +++ b/src/test/run-pass/swap-overlapping.rs @@ -10,6 +10,7 @@ // Issue #5041 - avoid overlapping memcpy when src and dest of a swap are the same +use std::ptr; use std::util; pub fn main() { diff --git a/src/test/run-pass/tag-disr-val-shape.rs b/src/test/run-pass/tag-disr-val-shape.rs index a562b79e4fd..d1dec9c44e0 100644 --- a/src/test/run-pass/tag-disr-val-shape.rs +++ b/src/test/run-pass/tag-disr-val-shape.rs @@ -18,7 +18,7 @@ enum color { pub fn main() { let act = fmt!("%?", red); - io::println(act); + println(act); assert_eq!(~"red", act); assert_eq!(~"green", fmt!("%?", green)); assert_eq!(~"white", fmt!("%?", white)); diff --git a/src/test/run-pass/tag-variant-disr-val.rs b/src/test/run-pass/tag-variant-disr-val.rs index d1e26a9c50c..a6252bf5f38 100644 --- a/src/test/run-pass/tag-variant-disr-val.rs +++ b/src/test/run-pass/tag-variant-disr-val.rs @@ -19,7 +19,7 @@ enum color { orange = 8 >> 1 } -impl cmp::Eq for color { +impl Eq for color { fn eq(&self, other: &color) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/tag.rs b/src/test/run-pass/tag.rs index 626e0938aed..ff251a70f65 100644 --- a/src/test/run-pass/tag.rs +++ b/src/test/run-pass/tag.rs @@ -8,13 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - - // -*- rust -*- + enum colour { red(int, int), green, } -impl cmp::Eq for colour { +impl Eq for colour { fn eq(&self, other: &colour) -> bool { match *self { red(a0, b0) => { diff --git a/src/test/run-pass/task-comm-0.rs b/src/test/run-pass/task-comm-0.rs index 90812f9a7f8..686cafb0119 100644 --- a/src/test/run-pass/task-comm-0.rs +++ b/src/test/run-pass/task-comm-0.rs @@ -14,6 +14,8 @@ extern mod extra; use std::comm::Chan; use std::comm::Port; +use std::comm; +use std::task; pub fn main() { test05(); } diff --git a/src/test/run-pass/task-comm-1.rs b/src/test/run-pass/task-comm-1.rs index b8e314c4c6e..4d34e3bae32 100644 --- a/src/test/run-pass/task-comm-1.rs +++ b/src/test/run-pass/task-comm-1.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::task; + pub fn main() { test00(); } fn start() { debug!("Started / Finished task."); } diff --git a/src/test/run-pass/task-comm-10.rs b/src/test/run-pass/task-comm-10.rs index b4b9592329b..15fbf8c07b8 100644 --- a/src/test/run-pass/task-comm-10.rs +++ b/src/test/run-pass/task-comm-10.rs @@ -12,6 +12,9 @@ extern mod extra; +use std::comm; +use std::task; + fn start(c: &comm::Chan<comm::Chan<~str>>) { let (p, ch) = comm::stream(); c.send(ch); diff --git a/src/test/run-pass/task-comm-11.rs b/src/test/run-pass/task-comm-11.rs index 2c6baf91862..8931531d544 100644 --- a/src/test/run-pass/task-comm-11.rs +++ b/src/test/run-pass/task-comm-11.rs @@ -12,6 +12,9 @@ extern mod extra; +use std::comm; +use std::task; + fn start(c: &comm::Chan<comm::Chan<int>>) { let (p, ch) = comm::stream(); c.send(ch); diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs index 9ecbbaeaee2..a241e9a49a7 100644 --- a/src/test/run-pass/task-comm-12.rs +++ b/src/test/run-pass/task-comm-12.rs @@ -10,6 +10,8 @@ extern mod extra; +use std::task; + pub fn main() { test00(); } fn start(task_number: int) { debug!("Started / Finished task."); } diff --git a/src/test/run-pass/task-comm-13.rs b/src/test/run-pass/task-comm-13.rs index f10aa46ae6e..b625b0557a7 100644 --- a/src/test/run-pass/task-comm-13.rs +++ b/src/test/run-pass/task-comm-13.rs @@ -12,6 +12,9 @@ extern mod extra; +use std::comm; +use std::task; + fn start(c: &comm::Chan<int>, start: int, number_of_messages: int) { let mut i: int = 0; while i < number_of_messages { c.send(start + i); i += 1; } diff --git a/src/test/run-pass/task-comm-14.rs b/src/test/run-pass/task-comm-14.rs index 8b4855deaa5..a637d951757 100644 --- a/src/test/run-pass/task-comm-14.rs +++ b/src/test/run-pass/task-comm-14.rs @@ -10,6 +10,9 @@ // xfail-fast +use std::comm; +use std::task; + pub fn main() { let po = comm::PortSet::new(); diff --git a/src/test/run-pass/task-comm-15.rs b/src/test/run-pass/task-comm-15.rs index 3941f846666..95f8e62523b 100644 --- a/src/test/run-pass/task-comm-15.rs +++ b/src/test/run-pass/task-comm-15.rs @@ -13,6 +13,9 @@ extern mod extra; +use std::comm; +use std::task; + fn start(c: &comm::Chan<int>, i0: int) { let mut i = i0; while i > 0 { diff --git a/src/test/run-pass/task-comm-16.rs b/src/test/run-pass/task-comm-16.rs index c9e8ae3ab79..d5a4b1a72c9 100644 --- a/src/test/run-pass/task-comm-16.rs +++ b/src/test/run-pass/task-comm-16.rs @@ -9,6 +9,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::comm; +use std::cmp; // Tests of ports and channels on various types fn test_rec() { diff --git a/src/test/run-pass/task-comm-17.rs b/src/test/run-pass/task-comm-17.rs index 25bddc7fe94..47e0a710a12 100644 --- a/src/test/run-pass/task-comm-17.rs +++ b/src/test/run-pass/task-comm-17.rs @@ -14,6 +14,8 @@ extern mod extra; +use std::task; + fn f() { } diff --git a/src/test/run-pass/task-comm-3.rs b/src/test/run-pass/task-comm-3.rs index faa1d8a69b1..dd8168ff947 100644 --- a/src/test/run-pass/task-comm-3.rs +++ b/src/test/run-pass/task-comm-3.rs @@ -11,7 +11,10 @@ // xfail-fast extern mod extra; + use std::comm::Chan; +use std::comm; +use std::task; pub fn main() { debug!("===== WITHOUT THREADS ====="); test00(); } diff --git a/src/test/run-pass/task-comm-4.rs b/src/test/run-pass/task-comm-4.rs index a1afefed2ee..2033092d2ce 100644 --- a/src/test/run-pass/task-comm-4.rs +++ b/src/test/run-pass/task-comm-4.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::comm; + pub fn main() { test00(); } fn test00() { diff --git a/src/test/run-pass/task-comm-5.rs b/src/test/run-pass/task-comm-5.rs index 22ca343ff17..472a7d7e3da 100644 --- a/src/test/run-pass/task-comm-5.rs +++ b/src/test/run-pass/task-comm-5.rs @@ -10,6 +10,8 @@ extern mod extra; +use std::comm; + pub fn main() { test00(); } fn test00() { diff --git a/src/test/run-pass/task-comm-6.rs b/src/test/run-pass/task-comm-6.rs index 16d6f53ad86..db6234857d6 100644 --- a/src/test/run-pass/task-comm-6.rs +++ b/src/test/run-pass/task-comm-6.rs @@ -9,6 +9,7 @@ // except according to those terms. use std::comm::Chan; +use std::comm; pub fn main() { test00(); } diff --git a/src/test/run-pass/task-comm-7.rs b/src/test/run-pass/task-comm-7.rs index 3cc1127fbbf..2ec3ff24089 100644 --- a/src/test/run-pass/task-comm-7.rs +++ b/src/test/run-pass/task-comm-7.rs @@ -12,6 +12,9 @@ extern mod extra; +use std::comm; +use std::task; + pub fn main() { test00(); } fn test00_start(c: &comm::Chan<int>, start: int, number_of_messages: int) { diff --git a/src/test/run-pass/task-comm-9.rs b/src/test/run-pass/task-comm-9.rs index 41e91097d27..d520949fb22 100644 --- a/src/test/run-pass/task-comm-9.rs +++ b/src/test/run-pass/task-comm-9.rs @@ -12,6 +12,9 @@ extern mod extra; +use std::comm; +use std::task; + pub fn main() { test00(); } fn test00_start(c: &comm::Chan<int>, number_of_messages: int) { diff --git a/src/test/run-pass/task-comm-chan-nil.rs b/src/test/run-pass/task-comm-chan-nil.rs index 64b587eff9a..8010089f3c6 100644 --- a/src/test/run-pass/task-comm-chan-nil.rs +++ b/src/test/run-pass/task-comm-chan-nil.rs @@ -12,6 +12,8 @@ extern mod extra; +use std::comm; + // rustboot can't transmit nils across channels because they don't have // any size, but rustc currently can because they do have size. Whether // or not this is desirable I don't know, but here's a regression test. diff --git a/src/test/run-pass/task-killjoin-rsrc.rs b/src/test/run-pass/task-killjoin-rsrc.rs index 4b89ddc4a6c..6d35a9228b0 100644 --- a/src/test/run-pass/task-killjoin-rsrc.rs +++ b/src/test/run-pass/task-killjoin-rsrc.rs @@ -15,6 +15,8 @@ use std::cell::Cell; use std::comm::*; +use std::ptr; +use std::task; struct notify { ch: Chan<bool>, v: @mut bool, diff --git a/src/test/run-pass/task-killjoin.rs b/src/test/run-pass/task-killjoin.rs index 73c069e560c..c94e00251d2 100644 --- a/src/test/run-pass/task-killjoin.rs +++ b/src/test/run-pass/task-killjoin.rs @@ -15,6 +15,8 @@ // task will kill the supervising task, waking it up. The supervising task no // longer needs to be wakened when the supervised task exits. +use std::task; + fn supervised() { // Yield to make sure the supervisor joins before we fail. This is // currently not needed because the supervisor runs first, but I can diff --git a/src/test/run-pass/task-life-0.rs b/src/test/run-pass/task-life-0.rs index 0ec62ff8541..370971bd7b9 100644 --- a/src/test/run-pass/task-life-0.rs +++ b/src/test/run-pass/task-life-0.rs @@ -9,6 +9,9 @@ // except according to those terms. extern mod extra; + +use std::task; + pub fn main() { task::spawn(|| child(~"Hello") ); } diff --git a/src/test/run-pass/task-spawn-move-and-copy.rs b/src/test/run-pass/task-spawn-move-and-copy.rs index 3e17c5d992c..f3a105e0852 100644 --- a/src/test/run-pass/task-spawn-move-and-copy.rs +++ b/src/test/run-pass/task-spawn-move-and-copy.rs @@ -9,6 +9,8 @@ // except according to those terms. use std::comm::*; +use std::ptr; +use std::task; pub fn main() { let (p, ch) = stream::<uint>(); diff --git a/src/test/run-pass/terminate-in-initializer.rs b/src/test/run-pass/terminate-in-initializer.rs index 0e1bf1e9062..6d34f7a9701 100644 --- a/src/test/run-pass/terminate-in-initializer.rs +++ b/src/test/run-pass/terminate-in-initializer.rs @@ -14,6 +14,8 @@ extern mod extra; +use std::task; + fn test_break() { loop { let x: @int = break; } } fn test_cont() { let mut i = 0; while i < 1 { i += 1; let x: @int = loop; } } diff --git a/src/test/run-pass/test-ignore-cfg.rs b/src/test/run-pass/test-ignore-cfg.rs index 536dd78bba1..d8b12437dfa 100644 --- a/src/test/run-pass/test-ignore-cfg.rs +++ b/src/test/run-pass/test-ignore-cfg.rs @@ -13,6 +13,8 @@ extern mod extra; +use std::vec; + #[test] #[ignore(cfg(ignorecfg))] fn shouldignore() { diff --git a/src/test/run-pass/threads.rs b/src/test/run-pass/threads.rs index 47b49513a60..8922ff91cfd 100644 --- a/src/test/run-pass/threads.rs +++ b/src/test/run-pass/threads.rs @@ -9,9 +9,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - extern mod extra; +use std::task; + pub fn main() { let mut i = 10; while i > 0 { task::spawn({let i = i; || child(i)}); i = i - 1; } diff --git a/src/test/run-pass/trait-generic.rs b/src/test/run-pass/trait-generic.rs index fedf6e25ec3..3aa30aab7c2 100644 --- a/src/test/run-pass/trait-generic.rs +++ b/src/test/run-pass/trait-generic.rs @@ -10,6 +10,8 @@ // xfail-fast +use std::int; + trait to_str { fn to_str(&self) -> ~str; } diff --git a/src/test/run-pass/trait-inheritance-num2.rs b/src/test/run-pass/trait-inheritance-num2.rs index ff9c792af29..bc1583a0878 100644 --- a/src/test/run-pass/trait-inheritance-num2.rs +++ b/src/test/run-pass/trait-inheritance-num2.rs @@ -99,7 +99,7 @@ impl FloatExt for f64 {} impl FloatExt for float {} -fn test_float_ext<T:FloatExt>(n: T) { io::println(fmt!("%?", n < n)) } +fn test_float_ext<T:FloatExt>(n: T) { println(fmt!("%?", n < n)) } pub fn main() { test_float_ext(1f32); diff --git a/src/test/run-pass/trait-inheritance-num3.rs b/src/test/run-pass/trait-inheritance-num3.rs index 98fa6a5ebf1..e0285a7b598 100644 --- a/src/test/run-pass/trait-inheritance-num3.rs +++ b/src/test/run-pass/trait-inheritance-num3.rs @@ -16,7 +16,7 @@ pub trait NumExt: Eq + Ord + Num + NumCast {} impl NumExt for f32 {} fn num_eq_one<T:NumExt>(n: T) { - io::println(fmt!("%?", n == NumCast::from(1))) + println(fmt!("%?", n == NumCast::from(1))) } pub fn main() { diff --git a/src/test/run-pass/trait-inheritance-self-in-supertype.rs b/src/test/run-pass/trait-inheritance-self-in-supertype.rs index 8105cf23d80..f28f8cadfd9 100644 --- a/src/test/run-pass/trait-inheritance-self-in-supertype.rs +++ b/src/test/run-pass/trait-inheritance-self-in-supertype.rs @@ -1,5 +1,8 @@ // Test for issue #4183: use of Self in supertraits. +use std::f32; +use std::f64; + pub static FUZZY_EPSILON: float = 0.1; pub trait FuzzyEq<Eps> { @@ -58,4 +61,4 @@ pub fn main() { assert!(compare::<f64>(6.19)); assert!(!compare::<f64>(7.28318530717958647692528676655900576)); assert!(!compare::<f64>(6.18)); -} \ No newline at end of file +} diff --git a/src/test/run-pass/trait-inheritance-self.rs b/src/test/run-pass/trait-inheritance-self.rs index 5eb87b7a96b..75b71c673a9 100644 --- a/src/test/run-pass/trait-inheritance-self.rs +++ b/src/test/run-pass/trait-inheritance-self.rs @@ -12,7 +12,7 @@ struct S { impl Foo<S> for S { fn f(&self, x: &S) { - io::println(x.x.to_str()); + println(x.x.to_str()); } } diff --git a/src/test/run-pass/trait-region-pointer-simple.rs b/src/test/run-pass/trait-region-pointer-simple.rs index 7162420dbc3..0b54ccbbd47 100644 --- a/src/test/run-pass/trait-region-pointer-simple.rs +++ b/src/test/run-pass/trait-region-pointer-simple.rs @@ -18,7 +18,7 @@ struct A { impl Foo for A { fn f(&self) -> int { - io::println(~"Today's number is " + self.x.to_str()); + println(~"Today's number is " + self.x.to_str()); return self.x; } } diff --git a/src/test/run-pass/trait-static-method-overwriting.rs b/src/test/run-pass/trait-static-method-overwriting.rs index 86ebc5356eb..1f5c33e2bc0 100644 --- a/src/test/run-pass/trait-static-method-overwriting.rs +++ b/src/test/run-pass/trait-static-method-overwriting.rs @@ -11,6 +11,8 @@ // except according to those terms. mod base { + use std::io; + pub trait HasNew<T> { fn new() -> T; } @@ -21,7 +23,7 @@ mod base { impl ::base::HasNew<Foo> for Foo { fn new() -> Foo { - unsafe { io::println("Foo"); } + unsafe { println("Foo"); } Foo { dummy: () } } } diff --git a/src/test/run-pass/trivial-message.rs b/src/test/run-pass/trivial-message.rs index 059d7ea5f70..2e0cc7e5a57 100644 --- a/src/test/run-pass/trivial-message.rs +++ b/src/test/run-pass/trivial-message.rs @@ -12,6 +12,9 @@ This is about the simplest program that can successfully send a message. */ + +use std::comm; + pub fn main() { let (po, ch) = comm::stream(); ch.send(42); diff --git a/src/test/run-pass/tuple-struct-construct.rs b/src/test/run-pass/tuple-struct-construct.rs index c5ea3e14d39..20be5df3242 100644 --- a/src/test/run-pass/tuple-struct-construct.rs +++ b/src/test/run-pass/tuple-struct-construct.rs @@ -12,5 +12,5 @@ struct Foo(int, int); pub fn main() { let x = Foo(1, 2); - io::println(fmt!("%?", x)); + println(fmt!("%?", x)); } diff --git a/src/test/run-pass/tuple-struct-destructuring.rs b/src/test/run-pass/tuple-struct-destructuring.rs index c7dc132f3b7..4a1258264f8 100644 --- a/src/test/run-pass/tuple-struct-destructuring.rs +++ b/src/test/run-pass/tuple-struct-destructuring.rs @@ -13,7 +13,7 @@ struct Foo(int, int); pub fn main() { let x = Foo(1, 2); let Foo(y, z) = x; - io::println(fmt!("%d %d", y, z)); + println(fmt!("%d %d", y, z)); assert_eq!(y, 1); assert_eq!(z, 2); } diff --git a/src/test/run-pass/tuple-struct-matching.rs b/src/test/run-pass/tuple-struct-matching.rs index 037f847629c..261b913b1d2 100644 --- a/src/test/run-pass/tuple-struct-matching.rs +++ b/src/test/run-pass/tuple-struct-matching.rs @@ -16,7 +16,7 @@ pub fn main() { Foo(a, b) => { assert_eq!(a, 1); assert_eq!(b, 2); - io::println(fmt!("%d %d", a, b)); + println(fmt!("%d %d", a, b)); } } } diff --git a/src/test/run-pass/type-use-i1-versus-i8.rs b/src/test/run-pass/type-use-i1-versus-i8.rs index d180f6c7260..88b4fffc5a5 100644 --- a/src/test/run-pass/type-use-i1-versus-i8.rs +++ b/src/test/run-pass/type-use-i1-versus-i8.rs @@ -8,8 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::unstable; + pub fn main() { - let mut x: bool = false; - // this line breaks it - unstable::intrinsics::move_val_init(&mut x, false); + unsafe { + let mut x: bool = false; + // this line breaks it + unstable::intrinsics::move_val_init(&mut x, false); + } } diff --git a/src/test/run-pass/unify-return-ty.rs b/src/test/run-pass/unify-return-ty.rs index 2f686d21b96..8bdce601b28 100644 --- a/src/test/run-pass/unify-return-ty.rs +++ b/src/test/run-pass/unify-return-ty.rs @@ -13,6 +13,8 @@ // in that type gets resolved. extern mod extra; +use std::cast; + fn null<T>() -> *T { unsafe { cast::transmute(0) diff --git a/src/test/run-pass/uniq-cc-generic.rs b/src/test/run-pass/uniq-cc-generic.rs index 7327f4a3498..b54b3b52692 100644 --- a/src/test/run-pass/uniq-cc-generic.rs +++ b/src/test/run-pass/uniq-cc-generic.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::ptr; + enum maybe_pointy { none, p(@mut Pointy), diff --git a/src/test/run-pass/unique-copy-box.rs b/src/test/run-pass/unique-copy-box.rs index 38a608c191b..7634641a56e 100644 --- a/src/test/run-pass/unique-copy-box.rs +++ b/src/test/run-pass/unique-copy-box.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::sys; + pub fn main() { unsafe { let i = ~@1; diff --git a/src/test/run-pass/unique-send-2.rs b/src/test/run-pass/unique-send-2.rs index 3684a6ef788..a6bed9e2398 100644 --- a/src/test/run-pass/unique-send-2.rs +++ b/src/test/run-pass/unique-send-2.rs @@ -9,6 +9,8 @@ // except according to those terms. use std::comm::*; +use std::task; +use std::uint; fn child(c: &SharedChan<~uint>, i: uint) { c.send(~i); diff --git a/src/test/run-pass/unit-like-struct.rs b/src/test/run-pass/unit-like-struct.rs index 1b81015b029..82aeb08a703 100644 --- a/src/test/run-pass/unit-like-struct.rs +++ b/src/test/run-pass/unit-like-struct.rs @@ -13,6 +13,6 @@ struct Foo; pub fn main() { let x: Foo = Foo; match x { - Foo => { io::println("hi"); } + Foo => { println("hi"); } } } diff --git a/src/test/run-pass/unwind-box.rs b/src/test/run-pass/unwind-box.rs index 5184ffb8d23..2d0967a6fa3 100644 --- a/src/test/run-pass/unwind-box.rs +++ b/src/test/run-pass/unwind-box.rs @@ -11,6 +11,8 @@ // xfail-win32 extern mod extra; +use std::task; + fn f() { let a = @0; fail!(); diff --git a/src/test/run-pass/unwind-resource.rs b/src/test/run-pass/unwind-resource.rs index 012b12ea99e..4b71d79ccc4 100644 --- a/src/test/run-pass/unwind-resource.rs +++ b/src/test/run-pass/unwind-resource.rs @@ -12,6 +12,7 @@ extern mod extra; use std::comm::*; +use std::task; struct complainer { c: SharedChan<bool>, diff --git a/src/test/run-pass/unwind-resource2.rs b/src/test/run-pass/unwind-resource2.rs index 0d7c717cd36..b5a496eb206 100644 --- a/src/test/run-pass/unwind-resource2.rs +++ b/src/test/run-pass/unwind-resource2.rs @@ -11,6 +11,8 @@ // xfail-win32 extern mod extra; +use std::task; + struct complainer { c: @int, } diff --git a/src/test/run-pass/unwind-unique.rs b/src/test/run-pass/unwind-unique.rs index f5f5209fa54..ba75676298b 100644 --- a/src/test/run-pass/unwind-unique.rs +++ b/src/test/run-pass/unwind-unique.rs @@ -11,6 +11,8 @@ // xfail-win32 extern mod extra; +use std::task; + fn f() { let a = ~0; fail!(); diff --git a/src/test/run-pass/utf8.rs b/src/test/run-pass/utf8.rs index aab51207a9f..fd5bc07e015 100644 --- a/src/test/run-pass/utf8.rs +++ b/src/test/run-pass/utf8.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::str; + pub fn main() { let yen: char = '¥'; // 0xa5 let c_cedilla: char = 'ç'; // 0xe7 diff --git a/src/test/run-pass/utf8_chars.rs b/src/test/run-pass/utf8_chars.rs index 23dddf59925..2343949f049 100644 --- a/src/test/run-pass/utf8_chars.rs +++ b/src/test/run-pass/utf8_chars.rs @@ -10,6 +10,9 @@ extern mod extra; +use std::str; +use std::vec; + pub fn main() { // Chars of 1, 2, 3, and 4 bytes let chs: ~[char] = ~['e', 'é', '€', 0x10000 as char]; diff --git a/src/test/run-pass/utf8_idents.rs b/src/test/run-pass/utf8_idents.rs index 4e86b6cc948..2e1bec53cee 100644 --- a/src/test/run-pass/utf8_idents.rs +++ b/src/test/run-pass/utf8_idents.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::float; + pub fn main() { let ε = 0.00001; let Π = 3.14; diff --git a/src/test/run-pass/vec-each2_mut.rs b/src/test/run-pass/vec-each2_mut.rs index 05314f94c67..73e0418993c 100644 --- a/src/test/run-pass/vec-each2_mut.rs +++ b/src/test/run-pass/vec-each2_mut.rs @@ -9,6 +9,10 @@ // except according to those terms. // -*- rust -*- + +use std::io; +use std::vec; + fn main(){ let mut t1 = ~[]; t1.push('a'); diff --git a/src/test/run-pass/vec-fixed-length.rs b/src/test/run-pass/vec-fixed-length.rs index 2c4add63e8b..56adc6d2598 100644 --- a/src/test/run-pass/vec-fixed-length.rs +++ b/src/test/run-pass/vec-fixed-length.rs @@ -10,5 +10,5 @@ pub fn main() { let x: [int, ..4] = [1, 2, 3, 4]; - io::println(fmt!("%d", x[0])); + println(fmt!("%d", x[0])); } diff --git a/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs b/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs index acd9a9664f7..aae287deb8a 100644 --- a/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs +++ b/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs @@ -5,6 +5,6 @@ pub fn main() { [1, ..ref tail] => &tail[0], _ => ::std::util::unreachable() }; - io::println(fmt!("%d", *el)); + println(fmt!("%d", *el)); } } diff --git a/src/test/run-pass/vec-slice.rs b/src/test/run-pass/vec-slice.rs index 25ae7340bc1..8448e4e0532 100644 --- a/src/test/run-pass/vec-slice.rs +++ b/src/test/run-pass/vec-slice.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::vec; + pub fn main() { let v = ~[1,2,3,4,5]; let v2 = vec::slice(v, 1, 3); diff --git a/src/test/run-pass/writealias.rs b/src/test/run-pass/writealias.rs index 7e2229e78ea..8f990e07015 100644 --- a/src/test/run-pass/writealias.rs +++ b/src/test/run-pass/writealias.rs @@ -9,15 +9,20 @@ // except according to those terms. +use std::unstable; - -// -*- rust -*- struct Point {x: int, y: int, z: int} fn f(p: &mut Point) { p.z = 13; } pub fn main() { - let mut x: Point = Point {x: 10, y: 11, z: 12}; - f(&mut x); - assert_eq!(x.z, 13); + unsafe { + let x = Some(unstable::sync::exclusive(true)); + match x { + Some(ref z) if z.with(|b| *b) => { + do z.with |b| { assert!(*b); } + }, + _ => fail!() + } + } } diff --git a/src/test/run-pass/yield.rs b/src/test/run-pass/yield.rs index 2d916abf0da..8beaee83864 100644 --- a/src/test/run-pass/yield.rs +++ b/src/test/run-pass/yield.rs @@ -9,6 +9,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::task; + pub fn main() { let mut result = None; let mut builder = task::task(); diff --git a/src/test/run-pass/yield1.rs b/src/test/run-pass/yield1.rs index f3ca5b12118..37ec8af7e57 100644 --- a/src/test/run-pass/yield1.rs +++ b/src/test/run-pass/yield1.rs @@ -9,6 +9,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::task; + pub fn main() { let mut result = None; let mut builder = task::task(); diff --git a/src/test/run-pass/yield2.rs b/src/test/run-pass/yield2.rs index 83b60d1863e..a2b8ef0429d 100644 --- a/src/test/run-pass/yield2.rs +++ b/src/test/run-pass/yield2.rs @@ -9,6 +9,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::task; + pub fn main() { let mut i: int = 0; while i < 100 { i = i + 1; error!(i); task::yield(); } diff --git a/src/test/run-pass/zip-same-length.rs b/src/test/run-pass/zip-same-length.rs index bf45b2fc039..83759dd82e6 100644 --- a/src/test/run-pass/zip-same-length.rs +++ b/src/test/run-pass/zip-same-length.rs @@ -11,6 +11,8 @@ // In this case, the code should compile and should // succeed at runtime +use std::vec; + fn enum_chars(start: u8, end: u8) -> ~[char] { assert!(start < end); let mut i = start; |
