diff --git a/doc/rust.md b/doc/rust.md index 719750ea7ca..9d96cc1dd98 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -1840,6 +1840,7 @@ is bounds-checked at run-time. When the check fails, it will put the task in a _failing state_. ~~~~ +# use std::task; # do task::spawn_unlinked { ([1, 2, 3, 4])[0]; @@ -2168,7 +2169,7 @@ fn ten_times(f: &fn(int)) { } } -ten_times(|j| io::println(fmt!("hello, %d", j))); +ten_times(|j| println(fmt!("hello, %d", j))); ~~~~ @@ -2189,7 +2190,7 @@ An example: let mut i = 0; while i < 10 { - io::println("hello\n"); + println("hello\n"); i = i + 1; } ~~~~ @@ -2335,6 +2336,7 @@ for v.each |e| { An example of a for loop over a series of integers: ~~~~ +# use std::uint; # fn bar(b:uint) { } for uint::range(0, 256) |i| { bar(i); @@ -2798,6 +2800,7 @@ the vtable pointer for the `T` implementation of `R`, and the pointer value of ` An example of an object type: ~~~~~~~~ +# use std::int; trait Printable { fn to_str(&self) -> ~str; } @@ -2807,7 +2810,7 @@ impl Printable for int { } fn print(a: @Printable) { - io::println(a.to_str()); + println(a.to_str()); } fn main() { diff --git a/doc/tutorial-ffi.md b/doc/tutorial-ffi.md index 33a8cd230bb..88f2f374cf5 100644 --- a/doc/tutorial-ffi.md +++ b/doc/tutorial-ffi.md @@ -149,7 +149,9 @@ A type with the same functionality as owned boxes can be implemented by wrapping `malloc` and `free`: ~~~~ +use std::cast; use std::libc::{c_void, size_t, malloc, free}; +use std::ptr; use std::unstable::intrinsics; use std::util; diff --git a/doc/tutorial-tasks.md b/doc/tutorial-tasks.md index 8c574e539fe..2f150755fc2 100644 --- a/doc/tutorial-tasks.md +++ b/doc/tutorial-tasks.md @@ -120,6 +120,7 @@ should interleave the output in vaguely random order. ~~~ # use std::io::print; # use std::task::spawn; +# use std::int; for int::range(0, 20) |child_task_number| { do spawn { @@ -236,6 +237,7 @@ Instead we can use a `SharedChan`, a type that allows a single ~~~ # use std::task::spawn; # use std::comm::{stream, SharedChan}; +# use std::uint; let (port, chan) = stream(); let chan = SharedChan::new(chan); @@ -269,6 +271,7 @@ might look like the example below. ~~~ # use std::task::spawn; # use std::comm::stream; +# use std::vec; // Create a vector of ports, one for each child task let ports = do vec::from_fn(3) |init_val| { @@ -310,6 +313,8 @@ the future needs to be mutable so that it can save the result for next time `get Here is another example showing how futures allow you to background computations. The workload will be distributed on the available cores. ~~~ +# use std::vec; +# use std::uint; fn partial_sum(start: uint) -> f64 { let mut local_sum = 0f64; for uint::range(start*100000, (start+1)*100000) |num| { @@ -343,6 +348,9 @@ acts as a reference to the shared data and only this reference is shared and clo Here is a small example showing how to use ARCs. We wish to run concurrently several computations on a single large vector of floats. Each task needs the full vector to perform its duty. ~~~ +# use std::vec; +# use std::uint; +# use std::rand; use extra::arc::ARC; fn pnorm(nums: &~[float], p: uint) -> float { @@ -350,7 +358,7 @@ fn pnorm(nums: &~[float], p: uint) -> float { } fn main() { - let numbers=vec::from_fn(1000000, |_| rand::random::()); + let numbers = vec::from_fn(1000000, |_| rand::random::()); println(fmt!("Inf-norm = %?", numbers.max())); let numbers_arc = ARC(numbers); @@ -373,12 +381,16 @@ at the power given as argument and takes the inverse power of this value). The A created by the line ~~~ # use extra::arc::ARC; -# let numbers=vec::from_fn(1000000, |_| rand::random::()); +# use std::vec; +# use std::rand; +# let numbers = vec::from_fn(1000000, |_| rand::random::()); let numbers_arc=ARC(numbers); ~~~ and a clone of it is sent to each task ~~~ # use extra::arc::ARC; +# use std::vec; +# use std::rand; # let numbers=vec::from_fn(1000000, |_| rand::random::()); # let numbers_arc = ARC(numbers); # let (port, chan) = stream(); @@ -389,6 +401,8 @@ copying only the wrapper and not its contents. Each task recovers the underlying data by ~~~ # use extra::arc::ARC; +# use std::vec; +# use std::rand; # let numbers=vec::from_fn(1000000, |_| rand::random::()); # let numbers_arc=ARC(numbers); # let (port, chan) = stream(); @@ -416,6 +430,7 @@ of all tasks are intertwined: if one fails, so do all the others. ~~~ # use std::task::spawn; +# use std::task; # fn do_some_work() { loop { task::yield() } } # do task::try { // Create a child task that fails @@ -437,6 +452,7 @@ field (representing a successful result) or an `Err` result (representing termination with an error). ~~~ +# use std::task; # fn some_condition() -> bool { false } # fn calculate_result() -> int { 0 } let result: Result = do task::try { @@ -479,6 +495,7 @@ By default, task failure is _bidirectionally linked_, which means that if either task fails, it kills the other one. ~~~ +# use std::task; # fn sleep_forever() { loop { task::yield() } } # do task::try { do spawn { @@ -501,6 +518,7 @@ before returning. Hence: ~~~ # use std::comm::{stream, Chan, Port}; # use std::task::{spawn, try}; +# use std::task; # fn sleep_forever() { loop { task::yield() } } # do task::try { let (receiver, sender): (Port, Chan) = stream(); @@ -528,6 +546,7 @@ Supervised task failure propagates across multiple generations even if an intermediate generation has already exited: ~~~ +# use std::task; # fn sleep_forever() { loop { task::yield() } } # fn wait_for_a_while() { for 1000.times { task::yield() } } # do task::try:: { @@ -546,6 +565,7 @@ Finally, tasks can be configured to not propagate failure to each other at all, using `task::spawn_unlinked` for _isolated failure_. ~~~ +# use std::task; # fn random() -> uint { 100 } # fn sleep_for(i: uint) { for i.times { task::yield() } } # do task::try::<()> { @@ -574,6 +594,7 @@ Here is the function that implements the child task: ~~~~ # use extra::comm::DuplexStream; +# use std::uint; fn stringifier(channel: &DuplexStream<~str, uint>) { let mut value: uint; loop { @@ -596,6 +617,7 @@ Here is the code for the parent task: ~~~~ # use std::task::spawn; +# use std::uint; # use extra::comm::DuplexStream; # fn stringifier(channel: &DuplexStream<~str, uint>) { # let mut value: uint; diff --git a/doc/tutorial.md b/doc/tutorial.md index 91a41cb9b85..14a0c6fdcfe 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -502,6 +502,7 @@ types. > items. ~~~~ +# use std::float; fn angle(vector: (float, float)) -> float { let pi = float::consts::pi; match vector { @@ -556,6 +557,7 @@ while cake_amount > 0 { `loop` denotes an infinite loop, and is the preferred way of writing `while true`: ~~~~ +# use std::int; let mut x = 5; loop { x += x - 3; @@ -699,6 +701,7 @@ get at their contents. All variant constructors can be used as patterns, as in this definition of `area`: ~~~~ +# use std::float; # struct Point {x: float, y: float} # enum Shape { Circle(Point, float), Rectangle(Point, Point) } fn area(sh: Shape) -> float { @@ -1829,6 +1832,7 @@ vector consisting of the result of applying `function` to each element of `vector`: ~~~~ +# use std::vec; fn map(vector: &[T], function: &fn(v: &T) -> U) -> ~[U] { let mut accumulator = ~[]; for vec::each(vector) |element| { @@ -2026,6 +2030,7 @@ themselves contain type parameters. A trait for generalized sequence types might look like the following: ~~~~ +# use std::vec; trait Seq { fn len(&self) -> uint; fn iter(&self, b: &fn(v: &T)); diff --git a/src/compiletest/compiletest.rc b/src/compiletest/compiletest.rc index e009839ba97..1ac6c215d27 100644 --- a/src/compiletest/compiletest.rc +++ b/src/compiletest/compiletest.rc @@ -16,13 +16,13 @@ #[no_std]; extern mod core(name = "std", vers = "0.7-pre"); -extern mod std(name = "extra", vers = "0.7-pre"); +extern mod extra(name = "extra", vers = "0.7-pre"); use core::prelude::*; use core::*; -use std::getopts; -use std::test; +use extra::getopts; +use extra::test; use core::result::{Ok, Err}; @@ -42,6 +42,13 @@ pub mod runtest; pub mod common; pub mod errors; +mod std { + pub use core::cmp; + pub use core::str; + pub use core::sys; + pub use core::unstable; +} + pub fn main() { let args = os::args(); let config = parse_config(args); diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 297ec9ee21e..728548caf77 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -10,6 +10,9 @@ use core::prelude::*; +use core::io; +use core::str; + pub struct ExpectedError { line: uint, kind: ~str, msg: ~str } // Load any test directives embedded in the file diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index cc4320248cd..2bfc92bc704 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -10,8 +10,12 @@ use core::prelude::*; -use common; use common::config; +use common; + +use core::io; +use core::os; +use core::str; pub struct TestProps { // Lines that should be expected, in order, on standard out diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs index a059f97daab..57a6dc8037e 100644 --- a/src/compiletest/procsrv.rs +++ b/src/compiletest/procsrv.rs @@ -10,7 +10,13 @@ use core::prelude::*; +use core::comm; +use core::io; +use core::libc::c_int; +use core::os; use core::run; +use core::str; +use core::task; #[cfg(target_os = "win32")] fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] { diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index c1586a1b350..4db1fa6d0a0 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -22,6 +22,12 @@ use procsrv; use util; use util::logv; +use core::io; +use core::os; +use core::str; +use core::uint; +use core::vec; + pub fn run(config: config, testfile: ~str) { if config.verbose { // We're going to be dumping a lot of info. Start on a new line. diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs index e9b09e8aee8..26a62f8a5b2 100644 --- a/src/compiletest/util.rs +++ b/src/compiletest/util.rs @@ -12,6 +12,7 @@ use core::prelude::*; use common::config; +use core::io; use core::os::getenv; pub fn make_new_path(path: &str) -> ~str { diff --git a/src/libextra/arc.rs b/src/libextra/arc.rs index e120f3dd033..e73b49044d4 100644 --- a/src/libextra/arc.rs +++ b/src/libextra/arc.rs @@ -510,9 +510,13 @@ pub impl<'self, T:Const + Owned> RWReadMode<'self, T> { #[cfg(test)] mod tests { use core::prelude::*; - use core::cell::Cell; + use arc::*; + use core::cell::Cell; + use core::comm; + use core::task; + #[test] fn manually_share_arc() { let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; @@ -541,59 +545,65 @@ mod tests { #[test] fn test_mutex_arc_condvar() { - let arc = ~MutexARC(false); - let arc2 = ~arc.clone(); - let (p,c) = comm::oneshot(); - let (c,p) = (Cell(c), Cell(p)); - do task::spawn || { - // wait until parent gets in - comm::recv_one(p.take()); - do arc2.access_cond |state, cond| { - *state = true; - cond.signal(); + unsafe { + let arc = ~MutexARC(false); + let arc2 = ~arc.clone(); + let (p,c) = comm::oneshot(); + let (c,p) = (Cell(c), Cell(p)); + do task::spawn || { + // wait until parent gets in + comm::recv_one(p.take()); + do arc2.access_cond |state, cond| { + *state = true; + cond.signal(); + } } - } - do arc.access_cond |state, cond| { - comm::send_one(c.take(), ()); - assert!(!*state); - while !*state { - cond.wait(); + do arc.access_cond |state, cond| { + comm::send_one(c.take(), ()); + assert!(!*state); + while !*state { + cond.wait(); + } } } } #[test] #[should_fail] #[ignore(cfg(windows))] fn test_arc_condvar_poison() { - let arc = ~MutexARC(1); - let arc2 = ~arc.clone(); - let (p, c) = comm::stream(); + unsafe { + let arc = ~MutexARC(1); + let arc2 = ~arc.clone(); + let (p, c) = comm::stream(); - do task::spawn_unlinked || { - let _ = p.recv(); - do arc2.access_cond |one, cond| { - cond.signal(); - // Parent should fail when it wakes up. - assert_eq!(*one, 0); + do task::spawn_unlinked || { + let _ = p.recv(); + do arc2.access_cond |one, cond| { + cond.signal(); + // Parent should fail when it wakes up. + assert_eq!(*one, 0); + } } - } - do arc.access_cond |one, cond| { - c.send(()); - while *one == 1 { - cond.wait(); + do arc.access_cond |one, cond| { + c.send(()); + while *one == 1 { + cond.wait(); + } } } } #[test] #[should_fail] #[ignore(cfg(windows))] fn test_mutex_arc_poison() { - let arc = ~MutexARC(1); - let arc2 = ~arc.clone(); - do task::try || { - do arc2.access |one| { - assert_eq!(*one, 2); + unsafe { + let arc = ~MutexARC(1); + let arc2 = ~arc.clone(); + do task::try || { + do arc2.access |one| { + assert_eq!(*one, 2); + } + }; + do arc.access |one| { + assert_eq!(*one, 1); } - }; - do arc.access |one| { - assert_eq!(*one, 1); } } #[test] #[should_fail] #[ignore(cfg(windows))] diff --git a/src/libextra/base64.rs b/src/libextra/base64.rs index 7829eb50a68..373bebeec71 100644 --- a/src/libextra/base64.rs +++ b/src/libextra/base64.rs @@ -12,6 +12,9 @@ use core::prelude::*; +use core::str; +use core::vec; + pub trait ToBase64 { fn to_base64(&self) -> ~str; } diff --git a/src/libextra/bitv.rs b/src/libextra/bitv.rs index 1a6e42d2fbb..afd82d42589 100644 --- a/src/libextra/bitv.rs +++ b/src/libextra/bitv.rs @@ -10,6 +10,12 @@ use core::prelude::*; +use core::cmp; +use core::ops; +use core::uint; +use core::vec::from_elem; +use core::vec; + struct SmallBitv { /// only the lowest nbits of this value are used. the rest is undefined. bits: uint diff --git a/src/libextra/c_vec.rs b/src/libextra/c_vec.rs index a8e71433ff8..7cc7b659ed9 100644 --- a/src/libextra/c_vec.rs +++ b/src/libextra/c_vec.rs @@ -38,6 +38,9 @@ use core::prelude::*; +use core::option; +use core::ptr; + /** * The type representing a foreign chunk of memory * diff --git a/src/libextra/comm.rs b/src/libextra/comm.rs index 095da6570fd..1ef61926c92 100644 --- a/src/libextra/comm.rs +++ b/src/libextra/comm.rs @@ -18,6 +18,7 @@ use core::prelude::*; use core::comm::{GenericChan, GenericSmartChan, GenericPort}; use core::comm::{Chan, Port, Selectable, Peekable}; +use core::comm; use core::pipes; /// An extension of `pipes::stream` that allows both sending and receiving. diff --git a/src/libextra/deque.rs b/src/libextra/deque.rs index ad3b6ab3df4..ccb52fa038c 100644 --- a/src/libextra/deque.rs +++ b/src/libextra/deque.rs @@ -12,7 +12,9 @@ use core::prelude::*; +use core::uint; use core::util::replace; +use core::vec; static initial_capacity: uint = 32u; // 2^5 diff --git a/src/libextra/dlist.rs b/src/libextra/dlist.rs index d3da13dde98..fc6cdb102a0 100644 --- a/src/libextra/dlist.rs +++ b/src/libextra/dlist.rs @@ -21,6 +21,8 @@ Do not use ==, !=, <, etc on doubly-linked lists -- it may not terminate. use core::prelude::*; use core::managed; +use core::old_iter; +use core::vec; pub type DListLink = Option<@mut DListNode>; @@ -538,6 +540,9 @@ mod tests { use super::*; + use core::old_iter; + use core::vec; + #[test] fn test_dlist_concat() { let a = from_vec([1,2]); diff --git a/src/libextra/fileinput.rs b/src/libextra/fileinput.rs index 42dde4ab890..e6f3fba6b15 100644 --- a/src/libextra/fileinput.rs +++ b/src/libextra/fileinput.rs @@ -96,6 +96,11 @@ total line count). use core::prelude::*; +use core::io::ReaderUtil; +use core::io; +use core::os; +use core::vec; + /** A summary of the internal state of a `FileInput` object. `line_num` and `line_num_file` represent the number of lines read in total and in @@ -407,6 +412,11 @@ mod test { use super::{FileInput, pathify, input_vec, input_vec_state}; + use core::io; + use core::str; + use core::uint; + use core::vec; + fn make_file(path : &Path, contents: &[~str]) { let file = io::file_writer(path, [io::Create, io::Truncate]).get(); diff --git a/src/libextra/flate.rs b/src/libextra/flate.rs index d184e67ab29..e24c80b4463 100644 --- a/src/libextra/flate.rs +++ b/src/libextra/flate.rs @@ -16,8 +16,9 @@ Simple compression use core::prelude::*; -use core::libc; use core::libc::{c_void, size_t, c_int}; +use core::libc; +use core::vec; pub mod rustrt { use core::libc::{c_int, c_void, size_t}; diff --git a/src/libextra/flatpipes.rs b/src/libextra/flatpipes.rs index 8cb94abcd38..955da13c7b3 100644 --- a/src/libextra/flatpipes.rs +++ b/src/libextra/flatpipes.rs @@ -345,11 +345,11 @@ pub mod flatteners { use core::cast; use core::io::{Writer, Reader, ReaderUtil}; + use core::io; use core::ptr; use core::sys::size_of; use core::vec; - // FIXME #4074: Copy + Owned != POD pub struct PodUnflattener { bogus: () @@ -511,8 +511,10 @@ pub mod bytepipes { use flatpipes::{ByteChan, BytePort}; - use core::io::{Writer, Reader, ReaderUtil}; use core::comm::{Port, Chan}; + use core::comm; + use core::io::{Writer, Reader, ReaderUtil}; + use core::vec; pub struct ReaderBytePort { reader: R @@ -646,7 +648,12 @@ mod test { use flatpipes::{BytePort, FlatChan, FlatPort}; use net::tcp::TcpSocketBuf; + use core::comm; + use core::int; use core::io::BytesWriter; + use core::result; + use core::sys; + use core::task; #[test] #[ignore(reason = "ebml failure")] @@ -873,6 +880,11 @@ mod test { use flatpipes::pod; use io_util::BufReader; + use core::comm; + use core::io; + use core::sys; + use core::task; + type PortLoader

= ~fn(~[u8]) -> FlatPort, P>; diff --git a/src/libextra/json.rs b/src/libextra/json.rs index 15823d68062..c3ef346dba3 100644 --- a/src/libextra/json.rs +++ b/src/libextra/json.rs @@ -16,8 +16,14 @@ use core::prelude::*; -use core::io::{WriterUtil, ReaderUtil}; +use core::char; +use core::float; use core::hashmap::HashMap; +use core::io::{WriterUtil, ReaderUtil}; +use core::io; +use core::str; +use core::to_str; +use core::vec; use serialize::Encodable; use serialize; @@ -1332,6 +1338,8 @@ mod tests { use super::*; use core::hashmap::HashMap; + use core::io; + use core::result; use std::serialize::Decodable; diff --git a/src/libextra/list.rs b/src/libextra/list.rs index 0cde57d5ad7..6f2c8447eca 100644 --- a/src/libextra/list.rs +++ b/src/libextra/list.rs @@ -8,10 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! A standard linked list +//! A standard, garbage-collected linked list. use core::prelude::*; +use core::vec; + #[deriving(Eq)] pub enum List { Cons(T, @List), diff --git a/src/libextra/net_tcp.rs b/src/libextra/net_tcp.rs index aaa10fe562a..8dff9b330a5 100644 --- a/src/libextra/net_tcp.rs +++ b/src/libextra/net_tcp.rs @@ -1451,6 +1451,10 @@ mod test { use core::cell::Cell; use core::comm::{stream, SharedChan}; + use core::io; + use core::result; + use core::str; + use core::task; // FIXME don't run on fbsd or linux 32 bit (#2064) #[cfg(target_os="win32")] diff --git a/src/libextra/num/bigint.rs b/src/libextra/num/bigint.rs index 7ff8c25d95f..0151c300a4a 100644 --- a/src/libextra/num/bigint.rs +++ b/src/libextra/num/bigint.rs @@ -19,7 +19,11 @@ A BigInt is a combination of BigUint and Sign. use core::prelude::*; use core::cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater}; +use core::int; use core::num::{IntConvertible, Zero, One, ToStrRadix, FromStrRadix, Orderable}; +use core::str; +use core::uint; +use core::vec; /** A BigDigit is a BigUint's composing element. @@ -1148,8 +1152,13 @@ mod biguint_tests { use core::prelude::*; use super::*; - use core::num::{IntConvertible, Zero, One, FromStrRadix}; + use core::cmp::{Less, Equal, Greater}; + use core::int; + use core::num::{IntConvertible, Zero, One, FromStrRadix}; + use core::str; + use core::uint; + use core::vec; #[test] fn test_from_slice() { @@ -1616,8 +1625,12 @@ mod bigint_tests { use core::prelude::*; use super::*; + use core::cmp::{Less, Equal, Greater}; + use core::int; use core::num::{IntConvertible, Zero, One, FromStrRadix}; + use core::uint; + use core::vec; #[test] fn test_from_biguint() { diff --git a/src/libextra/num/rational.rs b/src/libextra/num/rational.rs index de114a35e36..b33d113161c 100644 --- a/src/libextra/num/rational.rs +++ b/src/libextra/num/rational.rs @@ -13,8 +13,11 @@ use core::prelude::*; -use core::num::{Zero,One,ToStrRadix,FromStrRadix,Round}; +use core::cmp; use core::from_str::FromStr; +use core::num::{Zero,One,ToStrRadix,FromStrRadix,Round}; +use core::str; +use core::vec; use super::bigint::BigInt; /// Represents the ratio between 2 numbers. diff --git a/src/libextra/par.rs b/src/libextra/par.rs index 52e7d517d6e..49696a5fa25 100644 --- a/src/libextra/par.rs +++ b/src/libextra/par.rs @@ -10,6 +10,11 @@ use core::prelude::*; +use core::cast; +use core::ptr; +use core::sys; +use core::uint; +use core::vec; use future_spawn = future::spawn; /** diff --git a/src/libextra/priority_queue.rs b/src/libextra/priority_queue.rs index 4b84e2aa8c9..9345c246750 100644 --- a/src/libextra/priority_queue.rs +++ b/src/libextra/priority_queue.rs @@ -15,6 +15,7 @@ use core::prelude::*; use core::old_iter::BaseIter; use core::unstable::intrinsics::{move_val_init, init}; use core::util::{replace, swap}; +use core::vec; pub struct PriorityQueue { priv data: ~[T], diff --git a/src/libextra/rc.rs b/src/libextra/rc.rs index a1a14c31b28..73f98a3b19c 100644 --- a/src/libextra/rc.rs +++ b/src/libextra/rc.rs @@ -21,7 +21,10 @@ cycle cannot be created with `Rc` because there is no way to modify it after use core::prelude::*; +use core::cast; use core::libc::{c_void, size_t, malloc, free}; +use core::ptr; +use core::sys; use core::unstable::intrinsics; use core::util; diff --git a/src/libextra/rl.rs b/src/libextra/rl.rs index 41574424139..040adcc443d 100644 --- a/src/libextra/rl.rs +++ b/src/libextra/rl.rs @@ -14,6 +14,8 @@ use core::prelude::*; use core::libc::{c_char, c_int}; +use core::local_data; +use core::str; pub mod rustrt { use core::libc::{c_char, c_int}; diff --git a/src/libextra/rope.rs b/src/libextra/rope.rs index 4efe131c7cb..566bbfd6df6 100644 --- a/src/libextra/rope.rs +++ b/src/libextra/rope.rs @@ -35,6 +35,10 @@ use core::prelude::*; +use core::str; +use core::uint; +use core::vec; + /// The type of ropes. pub type Rope = node::Root; @@ -556,6 +560,11 @@ pub mod node { use rope::node; + use core::cast; + use core::str; + use core::uint; + use core::vec; + /// Implementation of type `rope` pub enum Root { /// An empty rope @@ -1137,6 +1146,8 @@ pub mod node { use rope::node::{Concat, Leaf, Node, height}; + use core::vec; + pub struct T { stack: ~[@Node], stackpos: int, @@ -1176,6 +1187,8 @@ pub mod node { pub mod char_iterator { use core::prelude::*; + use core::str; + use rope::node::{Leaf, Node}; use rope::node::leaf_iterator; @@ -1258,9 +1271,14 @@ pub mod node { #[cfg(test)] mod tests { - use rope::*; use core::prelude::*; + use rope::*; + + use core::str; + use core::uint; + use core::vec; + //Utility function, used for sanity check fn rope_to_string(r: Rope) -> ~str { match (r) { diff --git a/src/libextra/serialize.rs b/src/libextra/serialize.rs index 749e9d5dc61..d20aed69240 100644 --- a/src/libextra/serialize.rs +++ b/src/libextra/serialize.rs @@ -18,8 +18,11 @@ Core encoding and decoding interfaces. use core::prelude::*; +use core::at_vec; use core::hashmap::{HashMap, HashSet}; use core::trie::{TrieMap, TrieSet}; +use core::uint; +use core::vec; use deque::Deque; use dlist::DList; use treemap::{TreeMap, TreeSet}; diff --git a/src/libextra/smallintmap.rs b/src/libextra/smallintmap.rs index a3c02b2366d..a85f113b68f 100644 --- a/src/libextra/smallintmap.rs +++ b/src/libextra/smallintmap.rs @@ -15,11 +15,13 @@ use core::prelude::*; +use core::cmp; use core::container::{Container, Mutable, Map, Set}; use core::old_iter::BaseIter; use core::old_iter; -use core::option::{Some, None}; +use core::uint; use core::util::replace; +use core::vec; pub struct SmallIntMap { priv v: ~[Option], @@ -285,6 +287,11 @@ mod tests { use super::SmallIntMap; + use core::local_data; + use core::rand; + use core::uint; + use core::vec; + #[test] fn test_find_mut() { let mut m = SmallIntMap::new(); @@ -380,6 +387,8 @@ mod test_set { use super::SmallIntSet; + use core::vec; + #[test] fn test_disjoint() { let mut xs = SmallIntSet::new(); diff --git a/src/libextra/sort.rs b/src/libextra/sort.rs index 3039fa46f06..b3118dd37e1 100644 --- a/src/libextra/sort.rs +++ b/src/libextra/sort.rs @@ -13,9 +13,10 @@ use core::prelude::*; use core::cmp::{Eq, Ord}; +use core::uint; +use core::util::swap; use core::vec::len; use core::vec; -use core::util::swap; type Le<'self, T> = &'self fn(v1: &T, v2: &T) -> bool; @@ -926,7 +927,12 @@ mod test_tim_sort { use core::prelude::*; use sort::tim_sort; + + use core::local_data; use core::rand::RngUtil; + use core::rand; + use core::uint; + use core::vec; struct CVal { val: float, @@ -1019,7 +1025,12 @@ mod big_tests { use core::prelude::*; use sort::*; + + use core::local_data; use core::rand::RngUtil; + use core::rand; + use core::uint; + use core::vec; #[test] fn test_unique() { diff --git a/src/libextra/std.rc b/src/libextra/std.rc index 6166e65f4f7..8c03701f513 100644 --- a/src/libextra/std.rc +++ b/src/libextra/std.rc @@ -133,6 +133,9 @@ pub mod std { pub use core::condition; pub use core::cmp; pub use core::sys; + pub use core::unstable; + pub use core::str; + pub use core::os; } #[doc(hidden)] pub mod extra { diff --git a/src/libextra/sync.rs b/src/libextra/sync.rs index beea3b6f52b..5a1982d830d 100644 --- a/src/libextra/sync.rs +++ b/src/libextra/sync.rs @@ -17,9 +17,10 @@ use core::prelude::*; -use core::unstable::sync::{Exclusive, exclusive}; +use core::comm; use core::ptr; use core::task; +use core::unstable::sync::{Exclusive, exclusive}; use core::util; /**************************************************************************** @@ -728,6 +729,8 @@ mod tests { use core::cast; use core::cell::Cell; + use core::comm; + use core::ptr; use core::result; use core::task; use core::vec; diff --git a/src/libextra/task_pool.rs b/src/libextra/task_pool.rs index 926045a6b52..eba4f0d1b75 100644 --- a/src/libextra/task_pool.rs +++ b/src/libextra/task_pool.rs @@ -14,6 +14,7 @@ use core::prelude::*; use core::comm::Chan; +use core::comm; use core::task::SchedMode; use core::task; use core::vec; @@ -101,6 +102,6 @@ fn test_task_pool() { }; let mut pool = TaskPool::new(4, Some(SingleThreaded), f); for 8.times { - pool.execute(|i| io::println(fmt!("Hello from thread %u!", *i))); + pool.execute(|i| println(fmt!("Hello from thread %u!", *i))); } } diff --git a/src/libextra/tempfile.rs b/src/libextra/tempfile.rs index 7f073d0decb..c514631e787 100644 --- a/src/libextra/tempfile.rs +++ b/src/libextra/tempfile.rs @@ -12,7 +12,9 @@ use core::prelude::*; +use core::os; use core::rand::RngUtil; +use core::rand; pub fn mkdtemp(tmpdir: &Path, suffix: &str) -> Option { let mut r = rand::rng(); @@ -30,7 +32,10 @@ mod tests { use core::prelude::*; use tempfile::mkdtemp; + use tempfile; + use core::os; + use core::str; #[test] fn test_mkdtemp() { diff --git a/src/libextra/test.rs b/src/libextra/test.rs index ba2ee3c352e..59c6a12e036 100644 --- a/src/libextra/test.rs +++ b/src/libextra/test.rs @@ -21,8 +21,18 @@ use getopts; use sort; use term; -use core::to_str::ToStr; use core::comm::{stream, SharedChan}; +use core::either; +use core::io; +use core::num; +use core::option; +use core::result; +use core::str; +use core::task; +use core::to_str::ToStr; +use core::u64; +use core::uint; +use core::vec; pub mod rustrt { use core::libc::size_t; @@ -601,10 +611,14 @@ fn calc_result(desc: &TestDesc, task_succeeded: bool) -> TestResult { pub mod bench { use core::prelude::*; - use time::precise_time_ns; - use test::{BenchHarness, BenchSamples}; - use stats::Stats; + use core::num; use core::rand::RngUtil; + use core::rand; + use core::u64; + use core::vec; + use stats::Stats; + use test::{BenchHarness, BenchSamples}; + use time::precise_time_ns; pub impl BenchHarness { diff --git a/src/libextra/time.rs b/src/libextra/time.rs index d5a8cd78249..93fbf6a4054 100644 --- a/src/libextra/time.rs +++ b/src/libextra/time.rs @@ -10,6 +10,11 @@ use core::prelude::*; +use core::i32; +use core::int; +use core::io; +use core::str; + static NSEC_PER_SEC: i32 = 1_000_000_000_i32; pub mod rustrt { diff --git a/src/libextra/timer.rs b/src/libextra/timer.rs index 75caf1a4829..4f662613b00 100644 --- a/src/libextra/timer.rs +++ b/src/libextra/timer.rs @@ -19,6 +19,7 @@ use uv::iotask::IoTask; use core::cast::transmute; use core::cast; use core::comm::{stream, Chan, SharedChan, Port, select2i}; +use core::either; use core::libc::c_void; use core::libc; @@ -179,9 +180,12 @@ mod test { use timer::*; use uv; + use core::cell::Cell; - use core::rand::RngUtil; use core::pipes::{stream, SharedChan}; + use core::rand::RngUtil; + use core::rand; + use core::task; #[test] fn test_gl_timer_simple_sleep_test() { diff --git a/src/libextra/treemap.rs b/src/libextra/treemap.rs index 5551431b551..a05c532c92f 100644 --- a/src/libextra/treemap.rs +++ b/src/libextra/treemap.rs @@ -15,6 +15,7 @@ use core::prelude::*; use core::iterator::*; +use core::uint; use core::util::{swap, replace}; // This is implemented as an AA tree, which is a simplified variation of @@ -701,9 +702,13 @@ fn remove(node: &mut Option<~TreeNode>, mod test_treemap { use core::prelude::*; - use core::iterator::*; use super::*; + + use core::iterator::*; use core::rand::RngUtil; + use core::rand; + use core::str; + use core::vec; #[test] fn find_empty() { @@ -1021,8 +1026,11 @@ mod test_treemap { mod test_set { use core::prelude::*; use core::iterator::*; + use super::*; + use core::vec; + #[test] fn test_clear() { let mut s = TreeSet::new(); diff --git a/src/libextra/uv_global_loop.rs b/src/libextra/uv_global_loop.rs index ae59f91cf83..8752f675a8d 100644 --- a/src/libextra/uv_global_loop.rs +++ b/src/libextra/uv_global_loop.rs @@ -16,7 +16,9 @@ use iotask = uv_iotask; use uv_iotask::{IoTask, spawn_iotask}; use core::comm::Chan; +use core::libc; use core::option::{Some, None}; +use core::str; use core::task::task; use core::unstable::global::{global_data_clone_create, global_data_clone}; use core::unstable::weak_task::weaken_task; diff --git a/src/libextra/uv_iotask.rs b/src/libextra/uv_iotask.rs index ff726c1464c..6cf753b8016 100644 --- a/src/libextra/uv_iotask.rs +++ b/src/libextra/uv_iotask.rs @@ -22,6 +22,7 @@ use ll = uv_ll; use core::comm::{stream, Port, Chan, SharedChan}; use core::libc::c_void; use core::libc; +use core::task; /// Used to abstract-away direct interaction with a libuv loop. pub struct IoTask { @@ -223,6 +224,8 @@ struct AhData { #[cfg(test)] fn impl_uv_iotask_async(iotask: &IoTask) { + use core::ptr; + let async_handle = ll::async_t(); let ah_ptr: *ll::uv_async_t = &async_handle; let (exit_po, exit_ch) = stream::<()>(); diff --git a/src/libextra/uv_ll.rs b/src/libextra/uv_ll.rs index 5be8dd514de..d5f7cb12e4f 100644 --- a/src/libextra/uv_ll.rs +++ b/src/libextra/uv_ll.rs @@ -34,9 +34,12 @@ use core::prelude::*; -use core::libc::size_t; -use core::libc::c_void; +use core::libc::{c_void, size_t}; +use core::libc; use core::ptr::to_unsafe_ptr; +use core::ptr; +use core::str; +use core::vec; pub type uv_handle_t = c_void; pub type uv_loop_t = c_void; @@ -1225,9 +1228,17 @@ pub unsafe fn addrinfo_as_sockaddr_in6(input: *addrinfo) -> *sockaddr_in6 { #[cfg(test)] mod test { use core::prelude::*; - use core::comm::{SharedChan, stream, GenericChan, GenericPort}; + use super::*; + use core::comm::{SharedChan, stream, GenericChan, GenericPort}; + use core::libc; + use core::result; + use core::str; + use core::sys; + use core::task; + use core::vec; + enum tcp_read_data { tcp_read_eof, tcp_read_more(~[u8]), diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs index 9df9ffd9465..798cf1ba55d 100644 --- a/src/libextra/workcache.rs +++ b/src/libextra/workcache.rs @@ -21,7 +21,9 @@ use core::comm::{PortOne, oneshot, send_one, recv_one}; use core::either::{Either, Left, Right}; use core::hashmap::HashMap; use core::io; +use core::result; use core::run; +use core::task; use core::to_bytes; use core::util::replace; diff --git a/src/libfuzzer/fuzzer.rc b/src/libfuzzer/fuzzer.rc index 0107517ff3f..9280be146f9 100644 --- a/src/libfuzzer/fuzzer.rc +++ b/src/libfuzzer/fuzzer.rc @@ -28,7 +28,16 @@ extern mod extra(name = "extra", vers = "0.7-pre"); extern mod syntax(vers = "0.7-pre"); use std::prelude::*; + +use std::int; +use std::io; +use std::option; +use std::os; +use std::result; use std::run; +use std::str; +use std::uint; +use std::vec; use syntax::diagnostic; use syntax::parse::token::ident_interner; diff --git a/src/librust/rust.rc b/src/librust/rust.rc index 00925a5700a..ff766417c2a 100644 --- a/src/librust/rust.rc +++ b/src/librust/rust.rc @@ -31,8 +31,18 @@ extern mod rustc; use core::prelude::*; +use core::io; +use core::os; use core::run; use core::libc::exit; +use core::str; + +// For bootstrapping. +mod std { + pub use core::os; + pub use core::str; + pub use core::unstable; +} enum ValidUsage { Valid(int), Invalid diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index c3847ee4f15..785b79f66b9 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -22,12 +22,17 @@ use middle::trans::common::CrateContext; use middle::ty; use util::ppaux; +use core::char; use core::hash::Streaming; use core::hash; use core::libc::{c_int, c_uint}; use core::os::consts::{macos, freebsd, linux, android, win32}; +use core::os; +use core::ptr; use core::rt::io::Writer; use core::run; +use core::str; +use core::vec; use syntax::ast; use syntax::ast_map::{path, path_mod, path_name}; use syntax::attr; @@ -100,7 +105,12 @@ pub mod jit { use lib::llvm::{ModuleRef, PassManagerRef}; use metadata::cstore; + use core::cast; + use core::char; use core::libc::c_int; + use core::os; + use core::ptr; + use core::str; pub mod rusti { #[nolink] @@ -188,6 +198,7 @@ pub mod write { use core::libc::{c_int, c_uint}; use core::path::Path; use core::run; + use core::str; pub fn is_object_or_assembly_or_exe(ot: output_type) -> bool { if ot == output_type_assembly || ot == output_type_object || diff --git a/src/librustc/back/rpath.rs b/src/librustc/back/rpath.rs index 8695d0c79ef..16d10d0a35e 100644 --- a/src/librustc/back/rpath.rs +++ b/src/librustc/back/rpath.rs @@ -14,8 +14,11 @@ use driver::session; use metadata::cstore; use metadata::filesearch; -use core::util; use core::hashmap::HashSet; +use core::os; +use core::uint; +use core::util; +use core::vec; fn not_win32(os: session::os) -> bool { match os { @@ -210,6 +213,13 @@ pub fn minimize_rpaths(rpaths: &[Path]) -> ~[Path] { mod test { use core::prelude::*; + use core::os; + use core::str; + + // FIXME(#2119): the outer attribute should be #[cfg(unix, test)], then + // these redundant #[cfg(test)] blocks can be removed + #[cfg(test)] + #[cfg(test)] use back::rpath::{get_absolute_rpath, get_install_prefix_rpath}; use back::rpath::{get_relative_to, get_rpath_relative_to_output}; use back::rpath::{minimize_rpaths, rpaths_to_flags}; diff --git a/src/librustc/front/config.rs b/src/librustc/front/config.rs index b295e7524cf..f7ce376ca28 100644 --- a/src/librustc/front/config.rs +++ b/src/librustc/front/config.rs @@ -10,6 +10,8 @@ use core::prelude::*; +use core::option; +use core::vec; use syntax::{ast, fold, attr}; type in_cfg_pred = @fn(attrs: ~[ast::attribute]) -> bool; diff --git a/src/librustc/front/intrinsic_inject.rs b/src/librustc/front/intrinsic_inject.rs index 7a8a2a7eb97..2cdfd17c169 100644 --- a/src/librustc/front/intrinsic_inject.rs +++ b/src/librustc/front/intrinsic_inject.rs @@ -10,6 +10,7 @@ use core::prelude::*; +use core::vec; use driver::session::Session; use syntax::parse; use syntax::ast; diff --git a/src/librustc/front/std_inject.rs b/src/librustc/front/std_inject.rs index c8135abf334..a05dfc446ec 100644 --- a/src/librustc/front/std_inject.rs +++ b/src/librustc/front/std_inject.rs @@ -12,10 +12,11 @@ use core::prelude::*; use driver::session::Session; +use core::vec; use syntax::ast; use syntax::attr; -use syntax::codemap; use syntax::codemap::dummy_sp; +use syntax::codemap; use syntax::fold; static STD_VERSION: &'static str = "0.7-pre"; diff --git a/src/librustc/front/test.rs b/src/librustc/front/test.rs index e41f26aab08..08a19577308 100644 --- a/src/librustc/front/test.rs +++ b/src/librustc/front/test.rs @@ -15,6 +15,7 @@ use core::prelude::*; use driver::session; use front::config; +use core::vec; use syntax::ast_util::*; use syntax::attr; use syntax::codemap::{dummy_sp, span, ExpandedFrom, CallInfo, NameAndSpan}; @@ -309,7 +310,7 @@ fn mk_test_module(cx: &TestCtxt) -> @ast::item { let mainfn = (quote_item!( pub fn main() { #[main]; - extra::test::test_main_static(::os::args(), tests); + extra::test::test_main_static(::std::os::args(), tests); } )).get(); diff --git a/src/librustc/lib/llvm.rs b/src/librustc/lib/llvm.rs index a12a8be3b11..49a682e68f1 100644 --- a/src/librustc/lib/llvm.rs +++ b/src/librustc/lib/llvm.rs @@ -12,6 +12,10 @@ use core::prelude::*; use core::hashmap::HashMap; use core::libc::{c_uint, c_ushort}; +use core::option; +use core::ptr; +use core::str; +use core::vec; pub type Opcode = u32; pub type Bool = c_uint; diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index d189ddf9533..2c9b3c3a4ef 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -18,6 +18,7 @@ use metadata::filesearch::FileSearch; use metadata::loader; use core::hashmap::HashMap; +use core::vec; use syntax::attr; use syntax::codemap::{span, dummy_sp}; use syntax::diagnostic::span_handler; diff --git a/src/librustc/metadata/csearch.rs b/src/librustc/metadata/csearch.rs index 57d6c46d9f3..2a2419b0e30 100644 --- a/src/librustc/metadata/csearch.rs +++ b/src/librustc/metadata/csearch.rs @@ -18,6 +18,7 @@ use metadata::decoder; use metadata; use middle::{ty, resolve}; +use core::vec; use reader = extra::ebml::reader; use syntax::ast; use syntax::ast_map; diff --git a/src/librustc/metadata/cstore.rs b/src/librustc/metadata/cstore.rs index 6cc211e0e99..6cc01cb90b8 100644 --- a/src/librustc/metadata/cstore.rs +++ b/src/librustc/metadata/cstore.rs @@ -18,6 +18,7 @@ use metadata::cstore; use metadata::decoder; use core::hashmap::HashMap; +use core::vec; use extra; use syntax::ast; use syntax::parse::token::ident_interner; diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index 5467c50c7b8..a488d39d187 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -22,9 +22,14 @@ use middle::ty; use middle; use util::ppaux::ty_to_str; -use extra::flate; use core::hash::HashUtil; use core::hashmap::HashMap; +use core::int; +use core::io; +use core::str; +use core::uint; +use core::vec; +use extra::flate; use extra::serialize::Encodable; use extra; use syntax::abi::AbiSet; @@ -34,10 +39,10 @@ use syntax::ast_map; use syntax::ast_util::*; use syntax::attr; use syntax::diagnostic::span_handler; -use syntax::parse::token::special_idents; -use syntax::{ast_util, visit}; use syntax::opt_vec::OptVec; use syntax::opt_vec; +use syntax::parse::token::special_idents; +use syntax::{ast_util, visit}; use syntax; use writer = extra::ebml::writer; diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index 0d9b16d3117..4dbcd21e8f3 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -10,6 +10,11 @@ use core::prelude::*; +use core::option; +use core::os; +use core::result; +use core::str; + // A module for searching for libraries // FIXME (#2658): I'm not happy how this module turned out. Should // probably just be folded into cstore. diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs index 94060ab3271..5c64bd43943 100644 --- a/src/librustc/metadata/loader.rs +++ b/src/librustc/metadata/loader.rs @@ -23,8 +23,15 @@ use syntax::parse::token::ident_interner; use syntax::print::pprust; use syntax::{ast, attr}; -use extra::flate; +use core::cast; +use core::io; +use core::option; use core::os::consts::{macos, freebsd, linux, android, win32}; +use core::ptr; +use core::str; +use core::uint; +use core::vec; +use extra::flate; pub enum os { os_macos, diff --git a/src/librustc/metadata/tydecode.rs b/src/librustc/metadata/tydecode.rs index a726ca4bd52..f26a52cd8cd 100644 --- a/src/librustc/metadata/tydecode.rs +++ b/src/librustc/metadata/tydecode.rs @@ -18,6 +18,9 @@ use core::prelude::*; use middle::ty; +use core::str; +use core::uint; +use core::vec; use syntax::abi::AbiSet; use syntax::abi; use syntax::ast; diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index 3ebcf72e485..276b78d2e12 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -25,6 +25,9 @@ use middle::{ty, typeck, moves}; use middle; use util::ppaux::ty_to_str; +use core::at_vec; +use core::str; +use core::uint; use extra::ebml::reader; use extra::ebml; use extra::serialize; diff --git a/src/librustc/middle/borrowck/check_loans.rs b/src/librustc/middle/borrowck/check_loans.rs index 183771956ea..1801585900b 100644 --- a/src/librustc/middle/borrowck/check_loans.rs +++ b/src/librustc/middle/borrowck/check_loans.rs @@ -19,17 +19,18 @@ use core::prelude::*; -use middle::moves; -use middle::borrowck::*; -use mc = middle::mem_categorization; -use middle::ty; -use util::ppaux::Repr; use core::hashmap::HashSet; +use core::uint; +use mc = middle::mem_categorization; +use middle::borrowck::*; +use middle::moves; +use middle::ty; use syntax::ast::{m_mutbl, m_imm, m_const}; use syntax::ast; use syntax::ast_util; -use syntax::visit; use syntax::codemap::span; +use syntax::visit; +use util::ppaux::Repr; struct CheckLoanCtxt<'self> { bccx: @BorrowckCtxt, diff --git a/src/librustc/middle/borrowck/gather_loans/restrictions.rs b/src/librustc/middle/borrowck/gather_loans/restrictions.rs index 82a3b145e1d..6bd32f04ce5 100644 --- a/src/librustc/middle/borrowck/gather_loans/restrictions.rs +++ b/src/librustc/middle/borrowck/gather_loans/restrictions.rs @@ -12,6 +12,7 @@ use core::prelude::*; +use core::vec; use middle::borrowck::*; use mc = middle::mem_categorization; use middle::ty; diff --git a/src/librustc/middle/borrowck/mod.rs b/src/librustc/middle/borrowck/mod.rs index 1babf08aa70..066d0189fcb 100644 --- a/src/librustc/middle/borrowck/mod.rs +++ b/src/librustc/middle/borrowck/mod.rs @@ -23,8 +23,9 @@ use util::ppaux::{note_and_explain_region, Repr, UserString}; use core::hashmap::{HashSet, HashMap}; use core::io; -use core::result::{Result}; use core::ops::{BitOr, BitAnd}; +use core::result::{Result}; +use core::str; use syntax::ast; use syntax::ast_map; use syntax::visit; diff --git a/src/librustc/middle/borrowck/move_data.rs b/src/librustc/middle/borrowck/move_data.rs index 91962f17d59..2443c19ac97 100644 --- a/src/librustc/middle/borrowck/move_data.rs +++ b/src/librustc/middle/borrowck/move_data.rs @@ -16,7 +16,9 @@ comments in the section "Moves and initialization" and in `doc.rs`. */ use core::prelude::*; + use core::hashmap::{HashMap, HashSet}; +use core::uint; use middle::borrowck::*; use middle::dataflow::DataFlowContext; use middle::dataflow::DataFlowOperator; diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index 748ae83a60c..58c5ce6f2b5 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -19,6 +19,8 @@ use middle::typeck::method_map; use middle::moves; use util::ppaux::ty_to_str; +use core::uint; +use core::vec; use extra::sort; use syntax::ast::*; use syntax::ast_util::{unguarded_pat, walk_pat}; diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index 448ca4ab523..d68bbf8cdb3 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -18,7 +18,9 @@ use middle; use syntax::{ast, ast_map, ast_util, visit}; use syntax::ast::*; +use core::float; use core::hashmap::{HashMap, HashSet}; +use core::vec; // // This pass classifies expressions by their constant-ness. diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs index e0806359c5d..cd60279873a 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -19,7 +19,10 @@ use core::prelude::*; use core::cast; +use core::io; +use core::str; use core::uint; +use core::vec; use syntax::ast; use syntax::ast_util; use syntax::ast_util::id_range; diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index d2f0a5580ef..d809e653f69 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -73,15 +73,17 @@ pub fn check_crate(tcx: ty::ctxt, let visitor = visit::mk_vt(@visit::Visitor { visit_fn: |fn_kind, fn_decl, block, span, node_id, _, visitor| { - let is_unsafe_fn = match *fn_kind { - fk_item_fn(_, _, purity, _) => purity == unsafe_fn, - fk_method(_, _, method) => method.purity == unsafe_fn, - _ => false, + let (is_item_fn, is_unsafe_fn) = match *fn_kind { + fk_item_fn(_, _, purity, _) => (true, purity == unsafe_fn), + fk_method(_, _, method) => (true, method.purity == unsafe_fn), + _ => (false, false), }; let old_unsafe_context = context.unsafe_context; if is_unsafe_fn { context.unsafe_context = UnsafeFn + } else if is_item_fn { + context.unsafe_context = SafeContext } visit::visit_fn(fn_kind, @@ -97,7 +99,8 @@ pub fn check_crate(tcx: ty::ctxt, visit_block: |block, _, visitor| { let old_unsafe_context = context.unsafe_context; - if block.node.rules == unsafe_blk { + if block.node.rules == unsafe_blk && + context.unsafe_context == SafeContext { context.unsafe_context = UnsafeBlock(block.node.id) } diff --git a/src/librustc/middle/freevars.rs b/src/librustc/middle/freevars.rs index 9dffd09e548..7a57f78d60b 100644 --- a/src/librustc/middle/freevars.rs +++ b/src/librustc/middle/freevars.rs @@ -17,6 +17,7 @@ use middle::resolve; use middle::ty; use core::hashmap::HashMap; +use core::vec; use syntax::codemap::span; use syntax::{ast, ast_util, visit}; diff --git a/src/librustc/middle/kind.rs b/src/librustc/middle/kind.rs index a03191e2c4d..b988a88a901 100644 --- a/src/librustc/middle/kind.rs +++ b/src/librustc/middle/kind.rs @@ -18,6 +18,7 @@ use middle::typeck; use util::ppaux::{Repr, ty_to_str}; use util::ppaux::UserString; +use core::vec; use syntax::ast::*; use syntax::attr::attrs_contains_name; use syntax::codemap::span; diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 96ccb2999ae..56c024f12ae 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -15,7 +15,19 @@ use middle::ty; use middle::pat_util; use util::ppaux::{ty_to_str}; +use core::char; +use core::cmp; use core::hashmap::HashMap; +use core::i16; +use core::i32; +use core::i64; +use core::i8; +use core::str; +use core::u16; +use core::u32; +use core::u64; +use core::u8; +use core::vec; use extra::smallintmap::SmallIntMap; use syntax::attr; use syntax::codemap::span; diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 4897d6c87de..ee7b21638b2 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -112,6 +112,11 @@ use middle::moves; use core::cast::transmute; use core::hashmap::HashMap; +use core::io; +use core::old_iter; +use core::to_str; +use core::uint; +use core::vec; use syntax::ast::*; use syntax::codemap::span; use syntax::parse::token::special_idents; diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 0d335559747..3a14a681628 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -53,6 +53,7 @@ use middle::typeck; use util::ppaux::{ty_to_str, region_to_str, Repr}; use util::common::indenter; +use core::uint; use syntax::ast::{m_imm, m_const, m_mutbl}; use syntax::ast; use syntax::codemap::span; diff --git a/src/librustc/middle/moves.rs b/src/librustc/middle/moves.rs index abec56d32d7..c58ebcd1ee4 100644 --- a/src/librustc/middle/moves.rs +++ b/src/librustc/middle/moves.rs @@ -136,6 +136,7 @@ use util::ppaux; use util::ppaux::Repr; use util::common::indenter; +use core::at_vec; use core::hashmap::{HashSet, HashMap}; use syntax::ast::*; use syntax::ast_util; diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index 979d04e18c3..fa17fa04ed8 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -39,8 +39,10 @@ use syntax::visit::{visit_foreign_item, visit_item}; use syntax::visit::{visit_mod, visit_ty, vt}; use syntax::opt_vec::OptVec; -use core::option::Some; use core::str::each_split_str; +use core::str; +use core::uint; +use core::vec; use core::hashmap::{HashMap, HashSet}; use core::util; diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs index 9365a698a7e..ca7ce9c02d1 100644 --- a/src/librustc/middle/trans/_match.rs +++ b/src/librustc/middle/trans/_match.rs @@ -168,6 +168,7 @@ use middle::ty; use util::common::indenter; use core::hashmap::HashMap; +use core::vec; use syntax::ast; use syntax::ast::ident; use syntax::ast_util::path_to_ident; diff --git a/src/librustc/middle/trans/asm.rs b/src/librustc/middle/trans/asm.rs index fad5dc73c1a..bfcd6b16857 100644 --- a/src/librustc/middle/trans/asm.rs +++ b/src/librustc/middle/trans/asm.rs @@ -20,6 +20,7 @@ use middle::trans::callee; use middle::trans::common::*; use middle::ty; +use core::str; use syntax::ast; // Take an inline assembly expression and splat it out via LLVM diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index 678446023d1..a36eb39c049 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -66,7 +66,12 @@ use util::ppaux::{Repr, ty_to_str}; use core::hash; use core::hashmap::{HashMap, HashSet}; +use core::int; +use core::io; use core::libc::c_uint; +use core::str; +use core::uint; +use core::vec; use extra::time; use syntax::ast::ident; use syntax::ast_map::{path, path_elt_to_str, path_name}; diff --git a/src/librustc/middle/trans/build.rs b/src/librustc/middle/trans/build.rs index 7079c11e7d0..a77e27bf0fe 100644 --- a/src/librustc/middle/trans/build.rs +++ b/src/librustc/middle/trans/build.rs @@ -19,8 +19,11 @@ use middle::trans::common::*; use middle::trans::machine::llalign_of_min; use syntax::codemap::span; +use core::cast; use core::hashmap::HashMap; use core::libc::{c_uint, c_ulonglong, c_char}; +use core::str; +use core::vec; pub fn terminate(cx: block, _: &str) { cx.terminated = true; diff --git a/src/librustc/middle/trans/cabi_mips.rs b/src/librustc/middle/trans/cabi_mips.rs index 2282952ab88..c9fb01905fb 100644 --- a/src/librustc/middle/trans/cabi_mips.rs +++ b/src/librustc/middle/trans/cabi_mips.rs @@ -11,6 +11,9 @@ use core::prelude::*; use core::libc::c_uint; +use core::ptr; +use core::uint; +use core::vec; use lib::llvm::{llvm, TypeRef, Integer, Pointer, Float, Double}; use lib::llvm::{Struct, Array, Attribute}; use lib::llvm::{StructRetAttribute}; diff --git a/src/librustc/middle/trans/callee.rs b/src/librustc/middle/trans/callee.rs index b710f33d6ab..1e6e31e4277 100644 --- a/src/librustc/middle/trans/callee.rs +++ b/src/librustc/middle/trans/callee.rs @@ -43,6 +43,7 @@ use middle::ty; use middle::typeck; use util::ppaux::Repr; +use core::vec; use syntax::ast; use syntax::ast_map; use syntax::visit; diff --git a/src/librustc/middle/trans/closure.rs b/src/librustc/middle/trans/closure.rs index 335dd47b78b..fa3e6eeb0b6 100644 --- a/src/librustc/middle/trans/closure.rs +++ b/src/librustc/middle/trans/closure.rs @@ -26,6 +26,8 @@ use middle::trans::type_of::*; use middle::ty; use util::ppaux::ty_to_str; +use core::str; +use core::vec; use syntax::ast; use syntax::ast_map::path_name; use syntax::ast_util; diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs index ad5dadaf870..d148dbd2183 100644 --- a/src/librustc/middle/trans/common.rs +++ b/src/librustc/middle/trans/common.rs @@ -40,11 +40,15 @@ use middle::borrowck::root_map_key; use util::ppaux::{Repr}; use core::cast::transmute; +use core::cast; use core::hash; use core::hashmap::{HashMap, HashSet}; use core::libc::{c_uint, c_longlong, c_ulonglong}; +use core::ptr; +use core::str; use core::to_bytes; use core::vec::raw::to_ptr; +use core::vec; use syntax::ast::ident; use syntax::ast_map::{path, path_elt}; use syntax::codemap::span; diff --git a/src/librustc/middle/trans/consts.rs b/src/librustc/middle/trans/consts.rs index 97ccb6d7908..d47fc184cf3 100644 --- a/src/librustc/middle/trans/consts.rs +++ b/src/librustc/middle/trans/consts.rs @@ -31,6 +31,7 @@ use middle::ty; use util::ppaux::{Repr, ty_to_str}; use core::libc::c_uint; +use core::str; use syntax::{ast, ast_util, ast_map}; pub fn const_lit(cx: @CrateContext, e: @ast::expr, lit: ast::lit) diff --git a/src/librustc/middle/trans/controlflow.rs b/src/librustc/middle/trans/controlflow.rs index efe23aee9e6..5ef4376e811 100644 --- a/src/librustc/middle/trans/controlflow.rs +++ b/src/librustc/middle/trans/controlflow.rs @@ -24,6 +24,8 @@ use middle::ty; use util::common::indenter; use util::ppaux; +use core::str; +use core::vec; use syntax::ast; use syntax::ast::ident; use syntax::ast_map::path_mod; diff --git a/src/librustc/middle/trans/datum.rs b/src/librustc/middle/trans/datum.rs index 6be5dbe1beb..c8b9e3f8f0e 100644 --- a/src/librustc/middle/trans/datum.rs +++ b/src/librustc/middle/trans/datum.rs @@ -104,6 +104,7 @@ use util::common::indenter; use util::ppaux::ty_to_str; use core::to_bytes; +use core::uint; use syntax::ast; use syntax::codemap::span; use syntax::parse::token::special_idents; diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index 979559ad481..c1661b80cf8 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -20,8 +20,14 @@ use middle::trans; use middle::ty; use util::ppaux::ty_to_str; +use core::cast; use core::hashmap::HashMap; use core::libc; +use core::option; +use core::ptr; +use core::str; +use core::sys; +use core::vec; use syntax::codemap::span; use syntax::parse::token::ident_interner; use syntax::{ast, codemap, ast_util, ast_map}; diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs index d581d8043f8..99860e60c6b 100644 --- a/src/librustc/middle/trans/expr.rs +++ b/src/librustc/middle/trans/expr.rs @@ -154,6 +154,7 @@ use util::ppaux::Repr; use core::cast::transmute; use core::hashmap::HashMap; +use core::vec; use syntax::print::pprust::{expr_to_str}; use syntax::ast; use syntax::codemap; diff --git a/src/librustc/middle/trans/foreign.rs b/src/librustc/middle/trans/foreign.rs index 63356a135d0..a7a8cd088d2 100644 --- a/src/librustc/middle/trans/foreign.rs +++ b/src/librustc/middle/trans/foreign.rs @@ -34,6 +34,9 @@ use middle::ty; use middle::ty::FnSig; use util::ppaux::ty_to_str; +use core::str; +use core::uint; +use core::vec; use syntax::codemap::span; use syntax::{ast, ast_util}; use syntax::{attr, ast_map}; diff --git a/src/librustc/middle/trans/glue.rs b/src/librustc/middle/trans/glue.rs index 405e5e36de7..013a40c95c5 100644 --- a/src/librustc/middle/trans/glue.rs +++ b/src/librustc/middle/trans/glue.rs @@ -36,7 +36,10 @@ use middle::ty; use util::ppaux; use util::ppaux::ty_to_short_str; +use core::io; use core::libc::c_uint; +use core::str; +use core::vec; use extra::time; use syntax::ast; diff --git a/src/librustc/middle/trans/inline.rs b/src/librustc/middle/trans/inline.rs index aa4bb775323..1f9bdcb5abb 100644 --- a/src/librustc/middle/trans/inline.rs +++ b/src/librustc/middle/trans/inline.rs @@ -19,6 +19,7 @@ use middle::trans::common::*; use middle::ty; use util::ppaux::ty_to_str; +use core::vec; use syntax::ast; use syntax::ast_map::path_name; use syntax::ast_util::local_def; diff --git a/src/librustc/middle/trans/meth.rs b/src/librustc/middle/trans/meth.rs index 381c257f651..1e43a3c502b 100644 --- a/src/librustc/middle/trans/meth.rs +++ b/src/librustc/middle/trans/meth.rs @@ -31,6 +31,8 @@ use middle::typeck; use util::common::indenter; use util::ppaux::Repr; +use core::str; +use core::vec; use syntax::ast_map::{path, path_mod, path_name}; use syntax::ast_util; use syntax::{ast, ast_map}; diff --git a/src/librustc/middle/trans/monomorphize.rs b/src/librustc/middle/trans/monomorphize.rs index 1b3150f14b2..7e29d3bd33a 100644 --- a/src/librustc/middle/trans/monomorphize.rs +++ b/src/librustc/middle/trans/monomorphize.rs @@ -32,6 +32,7 @@ use middle::ty::{FnSig}; use middle::typeck; use util::ppaux::Repr; +use core::vec; use syntax::ast; use syntax::ast_map; use syntax::ast_map::path_name; diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index e17fe63af76..8815259b3cc 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -27,9 +27,17 @@ use util::ppaux::{Repr, UserString}; use util::common::{indenter}; use util::enum_set::{EnumSet, CLike}; +use core::cast; +use core::cmp; +use core::hashmap::{HashMap, HashSet}; +use core::iter; +use core::ops; use core::ptr::to_unsafe_ptr; use core::to_bytes; -use core::hashmap::{HashMap, HashSet}; +use core::u32; +use core::uint; +use core::vec; +use extra::smallintmap::SmallIntMap; use syntax::ast::*; use syntax::ast_util::is_local; use syntax::ast_util; diff --git a/src/librustc/middle/typeck/astconv.rs b/src/librustc/middle/typeck/astconv.rs index 5cc2b0dcedd..390ba2dc0de 100644 --- a/src/librustc/middle/typeck/astconv.rs +++ b/src/librustc/middle/typeck/astconv.rs @@ -63,6 +63,8 @@ use middle::typeck::rscope::{region_scope, RegionError}; use middle::typeck::rscope::RegionParamNames; use middle::typeck::lookup_def_tcx; +use core::result; +use core::vec; use syntax::abi::AbiSet; use syntax::{ast, ast_util}; use syntax::codemap::span; diff --git a/src/librustc/middle/typeck/check/_match.rs b/src/librustc/middle/typeck/check/_match.rs index 8edae63cea9..e469856f08f 100644 --- a/src/librustc/middle/typeck/check/_match.rs +++ b/src/librustc/middle/typeck/check/_match.rs @@ -19,6 +19,7 @@ use middle::typeck::check::{structure_of, valid_range_bounds}; use middle::typeck::require_same_types; use core::hashmap::{HashMap, HashSet}; +use core::vec; use syntax::ast; use syntax::ast_util; use syntax::codemap::span; diff --git a/src/librustc/middle/typeck/check/method.rs b/src/librustc/middle/typeck/check/method.rs index 68deb900886..1b7368b3dbf 100644 --- a/src/librustc/middle/typeck/check/method.rs +++ b/src/librustc/middle/typeck/check/method.rs @@ -96,6 +96,9 @@ use middle::typeck::check::regionmanip::replace_bound_regions_in_fn_sig; use util::common::indenter; use core::hashmap::HashSet; +use core::result; +use core::uint; +use core::vec; use extra::list::Nil; use syntax::ast::{def_id, sty_value, sty_region, sty_box}; use syntax::ast::{sty_uniq, sty_static, node_id}; diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index f25d451363b..7ba759e63ee 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -111,7 +111,10 @@ use util::ppaux; use core::cast::transmute; use core::hashmap::HashMap; +use core::result; +use core::str; use core::util::replace; +use core::vec; use extra::list::Nil; use syntax::abi::AbiSet; use syntax::ast::{provided, required}; diff --git a/src/librustc/middle/typeck/check/regionck.rs b/src/librustc/middle/typeck/check/regionck.rs index 642022c5b8f..13b9c59e2d9 100644 --- a/src/librustc/middle/typeck/check/regionck.rs +++ b/src/librustc/middle/typeck/check/regionck.rs @@ -36,10 +36,11 @@ use middle::typeck::check::FnCtxt; use middle::typeck::check::regionmanip::relate_nested_regions; use middle::typeck::infer::resolve_and_force_all_but_regions; use middle::typeck::infer::resolve_type; -use util::ppaux::{note_and_explain_region, ty_to_str, - region_to_str}; +use util::ppaux::{note_and_explain_region, ty_to_str, region_to_str}; use middle::pat_util; +use core::result; +use core::uint; use syntax::ast::{ManagedSigil, OwnedSigil, BorrowedSigil}; use syntax::ast::{def_arg, def_binding, def_local, def_self, def_upvar}; use syntax::ast; @@ -789,6 +790,8 @@ pub mod guarantor { use syntax::codemap::span; use util::ppaux::{ty_to_str}; + use core::uint; + pub fn for_addr_of(rcx: @mut Rcx, expr: @ast::expr, base: @ast::expr) { /*! * Computes the guarantor for an expression `&base` and then diff --git a/src/librustc/middle/typeck/check/vtable.rs b/src/librustc/middle/typeck/check/vtable.rs index 67d7b064115..37497e9a2bb 100644 --- a/src/librustc/middle/typeck/check/vtable.rs +++ b/src/librustc/middle/typeck/check/vtable.rs @@ -26,6 +26,8 @@ use util::ppaux::tys_to_str; use util::ppaux; use core::hashmap::HashSet; +use core::result; +use core::uint; use syntax::ast; use syntax::ast_util; use syntax::codemap::span; diff --git a/src/librustc/middle/typeck/coherence.rs b/src/librustc/middle/typeck/coherence.rs index 14a4034c6bb..f9aa01c0956 100644 --- a/src/librustc/middle/typeck/coherence.rs +++ b/src/librustc/middle/typeck/coherence.rs @@ -54,9 +54,11 @@ use syntax::visit::{Visitor, SimpleVisitor}; use syntax::visit::{visit_mod}; use util::ppaux::ty_to_str; -use core::result::Ok; use core::hashmap::{HashMap, HashSet}; +use core::old_iter; +use core::result::Ok; use core::uint; +use core::vec; pub struct UniversalQuantificationResult { monotype: t, diff --git a/src/librustc/middle/typeck/collect.rs b/src/librustc/middle/typeck/collect.rs index b3b59c2fc9e..a2c1211c5c4 100644 --- a/src/librustc/middle/typeck/collect.rs +++ b/src/librustc/middle/typeck/collect.rs @@ -47,6 +47,8 @@ use util::common::pluralize; use util::ppaux; use util::ppaux::UserString; +use core::result; +use core::vec; use syntax::abi::AbiSet; use syntax::ast::{RegionTyParamBound, TraitTyParamBound}; use syntax::ast; diff --git a/src/librustc/middle/typeck/infer/combine.rs b/src/librustc/middle/typeck/infer/combine.rs index d07752ee20a..f0fe4891807 100644 --- a/src/librustc/middle/typeck/infer/combine.rs +++ b/src/librustc/middle/typeck/infer/combine.rs @@ -68,6 +68,7 @@ use middle::typeck::infer::{cres, InferCtxt, ures}; use util::common::indent; use core::result::{iter_vec2, map_vec2}; +use core::vec; use syntax::ast::{Onceness, purity}; use syntax::ast; use syntax::opt_vec; diff --git a/src/librustc/middle/typeck/infer/mod.rs b/src/librustc/middle/typeck/infer/mod.rs index f2371e927b8..6a1fd05baf7 100644 --- a/src/librustc/middle/typeck/infer/mod.rs +++ b/src/librustc/middle/typeck/infer/mod.rs @@ -267,6 +267,8 @@ use middle::typeck::isr_alist; use util::common::indent; use util::ppaux::{bound_region_to_str, ty_to_str, trait_ref_to_str}; +use core::result; +use core::vec; use extra::list::Nil; use extra::smallintmap::SmallIntMap; use syntax::ast::{m_imm, m_mutbl}; diff --git a/src/librustc/middle/typeck/infer/resolve.rs b/src/librustc/middle/typeck/infer/resolve.rs index 217d9716f7d..ea0bdc68ac2 100644 --- a/src/librustc/middle/typeck/infer/resolve.rs +++ b/src/librustc/middle/typeck/infer/resolve.rs @@ -58,6 +58,7 @@ use middle::typeck::infer::unify::Root; use util::common::{indent, indenter}; use util::ppaux::ty_to_str; +use core::vec; use syntax::ast; pub static resolve_nested_tvar: uint = 0b0000000001; diff --git a/src/librustc/middle/typeck/infer/to_str.rs b/src/librustc/middle/typeck/infer/to_str.rs index 888339b707d..ef3b837e98a 100644 --- a/src/librustc/middle/typeck/infer/to_str.rs +++ b/src/librustc/middle/typeck/infer/to_str.rs @@ -18,6 +18,8 @@ use middle::typeck::infer::InferCtxt; use middle::typeck::infer::unify::{Redirect, Root, VarValue}; use util::ppaux::{mt_to_str, ty_to_str, trait_ref_to_str}; +use core::str; +use core::uint; use syntax::ast; pub trait InferStr { diff --git a/src/librustc/middle/typeck/mod.rs b/src/librustc/middle/typeck/mod.rs index b75654e7251..5cb4928d514 100644 --- a/src/librustc/middle/typeck/mod.rs +++ b/src/librustc/middle/typeck/mod.rs @@ -59,6 +59,7 @@ use util::ppaux::Repr; use util::ppaux; use core::hashmap::HashMap; +use core::result; use extra::list::List; use extra::list; use syntax::codemap::span; diff --git a/src/librustc/middle/typeck/rscope.rs b/src/librustc/middle/typeck/rscope.rs index 1f787e14f18..709d631de11 100644 --- a/src/librustc/middle/typeck/rscope.rs +++ b/src/librustc/middle/typeck/rscope.rs @@ -12,6 +12,7 @@ use core::prelude::*; use middle::ty; +use core::result; use syntax::ast; use syntax::codemap::span; use syntax::opt_vec::OptVec; diff --git a/src/librustc/rustc.rc b/src/librustc/rustc.rc index 019ca2a0ed5..07056a10f3a 100644 --- a/src/librustc/rustc.rc +++ b/src/librustc/rustc.rc @@ -34,6 +34,12 @@ extern mod std(name = "extra", vers = "0.7-pre"); #[cfg(not(stage0))] extern mod std(name = "std", vers = "0.7-pre"); +// For bootstrapping purposes. +#[cfg(stage0)] +pub use core::str; +#[cfg(stage0)] +pub use core::unstable; + use core::prelude::*; use driver::driver::{host_triple, optgroups, early_error}; @@ -44,6 +50,13 @@ use driver::driver::{compile_input}; use driver::session; use middle::lint; +use core::io; +use core::os; +use core::result; +use core::str; +use core::task; +use core::uint; +use core::vec; use extra::getopts::{groups, opt_present}; use extra::getopts; use syntax::codemap; @@ -148,6 +161,18 @@ pub mod lib { pub mod llvm; } +// A curious inner module that allows ::std::foo to be available in here for +// macros. +mod std { + pub use core::cmp; + pub use core::os; + pub use core::str; + pub use core::sys; + pub use core::to_bytes; + pub use core::unstable; + pub use extra::serialize; +} + pub fn version(argv0: &str) { let mut vers = ~"unknown version"; let env_vers = env!("CFG_VERSION"); diff --git a/src/librustc/util/common.rs b/src/librustc/util/common.rs index cbf1d0df09f..a44c409aa33 100644 --- a/src/librustc/util/common.rs +++ b/src/librustc/util/common.rs @@ -15,6 +15,8 @@ use syntax::codemap::{span}; use syntax::visit; use core::hashmap::HashSet; +use core::io; +use core::str; use extra; pub fn time(do_it: bool, what: ~str, thunk: &fn() -> T) -> T { diff --git a/src/librustc/util/enum_set.rs b/src/librustc/util/enum_set.rs index 6534a7ba9b0..4e9b7cf00a0 100644 --- a/src/librustc/util/enum_set.rs +++ b/src/librustc/util/enum_set.rs @@ -98,6 +98,7 @@ impl BitAnd, EnumSet> for EnumSet { mod test { use core::prelude::*; + use core::cast; use core::iter; use util::enum_set::*; diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 8694c0e356e..dcf631f0f7b 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -31,6 +31,9 @@ use syntax::codemap::span; use syntax::print::pprust; use syntax::{ast, ast_util}; +use core::str; +use core::vec; + /// Produces a string suitable for debugging output. pub trait Repr { fn repr(&self, tcx: ctxt) -> ~str; diff --git a/src/librustdoc/astsrv.rs b/src/librustdoc/astsrv.rs index 21ce70e7f5f..23810748b43 100644 --- a/src/librustdoc/astsrv.rs +++ b/src/librustdoc/astsrv.rs @@ -23,6 +23,8 @@ use parse; use core::cell::Cell; use core::comm::{stream, SharedChan, Port}; +use core::task; +use core::vec; use rustc::driver::driver; use rustc::driver::session::Session; use rustc::driver::session::{basic_options, options}; diff --git a/src/librustdoc/attr_parser.rs b/src/librustdoc/attr_parser.rs index 717b49dfe26..d2d9ec7d79b 100644 --- a/src/librustdoc/attr_parser.rs +++ b/src/librustdoc/attr_parser.rs @@ -17,6 +17,7 @@ an AST's attributes. use core::prelude::*; +use core::str; use syntax::ast; use syntax::attr; diff --git a/src/librustdoc/attr_pass.rs b/src/librustdoc/attr_pass.rs index 1e6d6d7bd89..a1dad7d17f8 100644 --- a/src/librustdoc/attr_pass.rs +++ b/src/librustdoc/attr_pass.rs @@ -27,6 +27,7 @@ use fold::Fold; use fold; use pass::Pass; +use core::vec; use syntax::ast; use syntax::ast_map; diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 603ce0de67d..4beb8583bae 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -11,9 +11,12 @@ use core::prelude::*; use core::cell::Cell; -use core::run; -use core::run::ProcessOutput; +use core::os; use core::result::Result; +use core::result; +use core::run::ProcessOutput; +use core::run; +use core::vec; use extra::getopts; /// The type of document to output @@ -243,7 +246,9 @@ pub fn maybe_find_pandoc( #[cfg(test)] mod test { use core::prelude::*; + use config::*; + use core::result; use core::run::ProcessOutput; fn parse_config(args: &[~str]) -> Result { diff --git a/src/librustdoc/desc_to_brief_pass.rs b/src/librustdoc/desc_to_brief_pass.rs index 972299d35f0..7a3ab259b1d 100644 --- a/src/librustdoc/desc_to_brief_pass.rs +++ b/src/librustdoc/desc_to_brief_pass.rs @@ -24,7 +24,9 @@ use fold::Fold; use fold; use pass::Pass; +use core::str; use core::util; +use core::vec; pub fn mk_pass() -> Pass { Pass { diff --git a/src/librustdoc/doc.rs b/src/librustdoc/doc.rs index b383a41a91c..2d5f60e714b 100644 --- a/src/librustdoc/doc.rs +++ b/src/librustdoc/doc.rs @@ -14,6 +14,8 @@ use core::prelude::*; use doc; +use core::vec; + pub type AstId = int; #[deriving(Eq)] diff --git a/src/librustdoc/extract.rs b/src/librustdoc/extract.rs index 3ef907d819d..3303a79d1b2 100644 --- a/src/librustdoc/extract.rs +++ b/src/librustdoc/extract.rs @@ -16,6 +16,8 @@ use astsrv; use doc::ItemUtils; use doc; +use core::local_data::local_data_get; +use core::vec; use syntax::ast; use syntax::parse::token::{ident_interner}; use syntax::parse::token; diff --git a/src/librustdoc/fold.rs b/src/librustdoc/fold.rs index 5bd394215a9..bd999b637c2 100644 --- a/src/librustdoc/fold.rs +++ b/src/librustdoc/fold.rs @@ -14,6 +14,8 @@ use doc; #[cfg(test)] use extract; #[cfg(test)] use parse; +use core::vec; + pub struct Fold { ctxt: T, fold_doc: FoldDoc, diff --git a/src/librustdoc/markdown_index_pass.rs b/src/librustdoc/markdown_index_pass.rs index 289aa33f67c..87a73f5c9d3 100644 --- a/src/librustdoc/markdown_index_pass.rs +++ b/src/librustdoc/markdown_index_pass.rs @@ -22,6 +22,8 @@ use markdown_pass; use markdown_writer; use pass::Pass; +use core::str; + pub fn mk_pass(config: config::Config) -> Pass { Pass { name: ~"markdown_index", diff --git a/src/librustdoc/markdown_pass.rs b/src/librustdoc/markdown_pass.rs index a3ad8d8d04d..d34aa7c9955 100644 --- a/src/librustdoc/markdown_pass.rs +++ b/src/librustdoc/markdown_pass.rs @@ -23,6 +23,8 @@ use pass::Pass; use sort_pass; use core::cell::Cell; +use core::str; +use core::vec; use syntax; pub fn mk_pass(writer_factory: WriterFactory) -> Pass { @@ -539,6 +541,8 @@ mod test { use tystr_pass; use unindent_pass; + use core::str; + fn render(source: ~str) -> ~str { let (srv, doc) = create_doc_srv(source); let markdown = write_markdown_str_srv(srv, doc); diff --git a/src/librustdoc/markdown_writer.rs b/src/librustdoc/markdown_writer.rs index 973326b10dc..86b51dfabf0 100644 --- a/src/librustdoc/markdown_writer.rs +++ b/src/librustdoc/markdown_writer.rs @@ -14,8 +14,15 @@ use config; use doc::ItemUtils; use doc; -use core::run; use core::comm::*; +use core::comm; +use core::io; +use core::libc; +use core::os; +use core::result; +use core::run; +use core::str; +use core::task; use extra::future; pub enum WriteInstr { diff --git a/src/librustdoc/page_pass.rs b/src/librustdoc/page_pass.rs index 581bc742eb9..29a6765f16d 100644 --- a/src/librustdoc/page_pass.rs +++ b/src/librustdoc/page_pass.rs @@ -27,6 +27,7 @@ use pass::Pass; use util::NominalOp; use core::comm::*; +use core::task; use syntax::ast; #[cfg(test)] use doc::PageUtils; diff --git a/src/librustdoc/pass.rs b/src/librustdoc/pass.rs index 95998ba1358..8a51339c896 100644 --- a/src/librustdoc/pass.rs +++ b/src/librustdoc/pass.rs @@ -10,6 +10,8 @@ use core::prelude::*; +use core::vec; + use astsrv; use doc; use time; diff --git a/src/librustdoc/rustdoc.rc b/src/librustdoc/rustdoc.rc index d4a25f6eb8b..7ed5d5f5516 100644 --- a/src/librustdoc/rustdoc.rc +++ b/src/librustdoc/rustdoc.rc @@ -66,6 +66,15 @@ pub mod escape_pass; pub mod prune_private_pass; pub mod util; +mod std { + pub use core::clone; + pub use core::cmp; + pub use core::os; + pub use core::str; + pub use core::sys; + pub use core::unstable; +} + pub fn main() { let args = os::args(); diff --git a/src/librustdoc/sectionalize_pass.rs b/src/librustdoc/sectionalize_pass.rs index ed069b5ed56..1a475879fc1 100644 --- a/src/librustdoc/sectionalize_pass.rs +++ b/src/librustdoc/sectionalize_pass.rs @@ -19,6 +19,8 @@ use fold::Fold; use fold; use pass::Pass; +use core::str; + pub fn mk_pass() -> Pass { Pass { name: ~"sectionalize", @@ -170,6 +172,9 @@ mod test { use extract; use sectionalize_pass::run; + use core::str; + use core::vec; + fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(copy source) |srv| { let doc = extract::from_srv(srv.clone(), ~""); diff --git a/src/librustdoc/text_pass.rs b/src/librustdoc/text_pass.rs index 61f66c43521..7e5444af05c 100644 --- a/src/librustdoc/text_pass.rs +++ b/src/librustdoc/text_pass.rs @@ -149,6 +149,8 @@ mod test { use sectionalize_pass; use text_pass::mk_pass; + use core::str; + fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(copy source) |srv| { let doc = extract::from_srv(srv.clone(), ~""); diff --git a/src/librustdoc/tystr_pass.rs b/src/librustdoc/tystr_pass.rs index 716784c51c5..57a45d3dcc2 100644 --- a/src/librustdoc/tystr_pass.rs +++ b/src/librustdoc/tystr_pass.rs @@ -21,6 +21,7 @@ use fold::Fold; use fold; use pass::Pass; +use core::vec; use syntax::ast; use syntax::print::pprust; use syntax::ast_map; diff --git a/src/librustdoc/unindent_pass.rs b/src/librustdoc/unindent_pass.rs index ef34de113cf..e78edf1fbf3 100644 --- a/src/librustdoc/unindent_pass.rs +++ b/src/librustdoc/unindent_pass.rs @@ -21,6 +21,10 @@ middle of a line, and each of the following lines is indented. use core::prelude::*; +use core::str; +use core::task; +use core::uint; +use core::vec; use pass::Pass; use text_pass; diff --git a/src/librusti/rusti.rc b/src/librusti/rusti.rc index 9486d9d1ffc..d17379a2193 100644 --- a/src/librusti/rusti.rc +++ b/src/librusti/rusti.rc @@ -223,7 +223,7 @@ fn compile_crate(src_filename: ~str, binary: ~str) -> Option { None => { }, } if (should_compile) { - io::println(fmt!("compiling %s...", src_filename)); + println(fmt!("compiling %s...", src_filename)); driver::compile_upto(sess, cfg, &input, driver::cu_everything, Some(outputs)); true @@ -271,7 +271,7 @@ fn run_cmd(repl: &mut Repl, _in: @io::Reader, _out: @io::Writer, //rl::clear(); } ~"help" => { - io::println( + println( ~":{\\n ..lines.. \\n:}\\n - execute multiline command\n" + ":load ... - \ loads given crates as dynamic libraries\n" + @@ -305,9 +305,9 @@ fn run_cmd(repl: &mut Repl, _in: @io::Reader, _out: @io::Writer, } } if loaded_crates.is_empty() { - io::println("no crates loaded"); + println("no crates loaded"); } else { - io::println(fmt!("crates loaded: %s", + println(fmt!("crates loaded: %s", str::connect(loaded_crates, ", "))); } } @@ -328,7 +328,7 @@ fn run_cmd(repl: &mut Repl, _in: @io::Reader, _out: @io::Writer, } action = action_run_line(multiline_cmd); } - _ => io::println(~"unknown cmd: " + cmd) + _ => println(~"unknown cmd: " + cmd) } return action; } @@ -394,9 +394,9 @@ pub fn main() { // only print this stuff if the user is actually typing into rusti if istty { - io::println("WARNING: The Rust REPL is experimental and may be"); - io::println("unstable. If you encounter problems, please use the"); - io::println("compiler instead. Type :help for help."); + println("WARNING: The Rust REPL is experimental and may be"); + println("unstable. If you encounter problems, please use the"); + println("compiler instead. Type :help for help."); unsafe { do rl::complete |line, suggest| { @@ -416,7 +416,7 @@ pub fn main() { Some(line) => { if line.is_empty() { if istty { - io::println("()"); + println("()"); } loop; } diff --git a/src/librusti/wrapper.rs b/src/librusti/wrapper.rs index 9c3026f0915..664e5e3b246 100644 --- a/src/librusti/wrapper.rs +++ b/src/librusti/wrapper.rs @@ -26,5 +26,5 @@ extern mod std; fn print(result: T) { - io::println(fmt!("%?", result)); + println(fmt!("%?", result)); } diff --git a/src/librustpkg/path_util.rs b/src/librustpkg/path_util.rs index 700b3338a3a..2fca0419629 100644 --- a/src/librustpkg/path_util.rs +++ b/src/librustpkg/path_util.rs @@ -11,10 +11,12 @@ // rustpkg utilities having to do with paths and directories use core::prelude::*; + pub use util::{PkgId, RemotePath, LocalPath}; +pub use util::{normalize, OutputType, Main, Lib, Bench, Test}; use core::libc::consts::os::posix88::{S_IRUSR, S_IWUSR, S_IXUSR}; use core::os::mkdir_recursive; -pub use util::{normalize, OutputType, Main, Lib, Bench, Test}; +use core::os; /// Returns the value of RUST_PATH, as a list /// of Paths. In general this should be read from the diff --git a/src/librustpkg/rustpkg.rc b/src/librustpkg/rustpkg.rc index ae4bfc6bc4b..6b560541e52 100644 --- a/src/librustpkg/rustpkg.rc +++ b/src/librustpkg/rustpkg.rc @@ -21,7 +21,7 @@ #[no_std]; extern mod core(name = "std"); -extern mod std(name = "extra"); +extern mod extra(name = "extra"); extern mod rustc; extern mod syntax; @@ -32,7 +32,7 @@ pub use core::path::Path; use core::hashmap::HashMap; use rustc::driver::{driver, session}; use rustc::metadata::filesearch; -use std::{getopts}; +use extra::{getopts}; use syntax::{ast, diagnostic}; use util::*; use path_util::{build_pkg_id_in_workspace, pkgid_src_in_workspace, u_rwx}; @@ -51,6 +51,15 @@ mod workspace; pub mod usage; +mod std { + pub use core::cmp; + pub use core::condition; + pub use core::os; + pub use core::str; + pub use core::sys; + pub use core::unstable; +} + /// A PkgScript represents user-supplied custom logic for /// special build hooks. This only exists for packages with /// an explicit package script. diff --git a/src/librustpkg/tests.rs b/src/librustpkg/tests.rs index 6a69eb71eaf..9499430ef4c 100644 --- a/src/librustpkg/tests.rs +++ b/src/librustpkg/tests.rs @@ -12,8 +12,11 @@ use context::Ctx; use core::hashmap::HashMap; +use core::io; +use core::os; use core::prelude::*; -use std::tempfile::mkdtemp; +use core::result; +use extra::tempfile::mkdtemp; use util::{PkgId, default_version}; use path_util::{target_executable_in_workspace, target_library_in_workspace, target_test_in_workspace, target_bench_in_workspace, diff --git a/src/librustpkg/util.rs b/src/librustpkg/util.rs index 80533b2d3b1..8019b3b8afb 100644 --- a/src/librustpkg/util.rs +++ b/src/librustpkg/util.rs @@ -15,9 +15,9 @@ use core::hash::Streaming; use core::rt::io::Writer; use rustc::driver::{driver, session}; use rustc::metadata::filesearch; -use std::getopts::groups::getopts; -use std::semver; -use std::term; +use extra::getopts::groups::getopts; +use extra::semver; +use extra::term; use syntax::ast_util::*; use syntax::codemap::{dummy_sp, spanned, dummy_spanned}; use syntax::ext::base::ExtCtxt; diff --git a/src/libstd/at_vec.rs b/src/libstd/at_vec.rs index 7a41c278fa3..e3d3642d6c7 100644 --- a/src/libstd/at_vec.rs +++ b/src/libstd/at_vec.rs @@ -282,6 +282,8 @@ mod test { use super::*; use prelude::*; + use uint; + #[test] fn test() { // Some code that could use that, then: diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index d1fa9e697bf..b80d3ae68f8 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -11,6 +11,7 @@ //! A mutable, nullable memory location use cast::transmute_mut; +use cmp; use prelude::*; use util::replace; diff --git a/src/libstd/condition.rs b/src/libstd/condition.rs index baa6722b193..94b32b6af4c 100644 --- a/src/libstd/condition.rs +++ b/src/libstd/condition.rs @@ -10,8 +10,9 @@ /*! Condition handling */ -use prelude::*; use local_data::{local_data_pop, local_data_set}; +use local_data; +use prelude::*; // helper for transmutation, shown below. type RustClosure = (int, int); diff --git a/src/libstd/core.rc b/src/libstd/core.rc index 3d5f0fb8493..85397cbe777 100644 --- a/src/libstd/core.rc +++ b/src/libstd/core.rc @@ -224,5 +224,8 @@ mod std { pub use kinds; pub use sys; pub use pipes; + pub use unstable; + pub use str; + pub use os; } diff --git a/src/libstd/hash.rs b/src/libstd/hash.rs index 7eb2054a35d..9828ff4e317 100644 --- a/src/libstd/hash.rs +++ b/src/libstd/hash.rs @@ -387,6 +387,8 @@ mod tests { use super::*; use prelude::*; + use uint; + #[test] fn test_siphash() { let vecs : [[u8, ..8], ..64] = [ diff --git a/src/libstd/iter.rs b/src/libstd/iter.rs index 800ce9f05dc..5847034d026 100644 --- a/src/libstd/iter.rs +++ b/src/libstd/iter.rs @@ -257,6 +257,9 @@ mod tests { use super::*; use prelude::*; + use int; + use uint; + #[test] fn test_to_vec() { let xs = ~[1, 2, 3]; diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs index a5679e6dbff..69bb1b0b766 100644 --- a/src/libstd/iterator.rs +++ b/src/libstd/iterator.rs @@ -17,8 +17,11 @@ implementing the `Iterator` trait. */ -use prelude::*; +use cmp; +use iter; use num::{Zero, One}; +use num; +use prelude::*; pub trait Iterator { /// Advance the iterator and return the next value. Return `None` when the end is reached. @@ -506,6 +509,9 @@ mod tests { use super::*; use prelude::*; + use iter; + use uint; + #[test] fn test_counter_to_vec() { let mut it = Counter::new(0, 5).take(10); diff --git a/src/libstd/local_data.rs b/src/libstd/local_data.rs index 2cbf8b9f05e..6227f9ad388 100644 --- a/src/libstd/local_data.rs +++ b/src/libstd/local_data.rs @@ -27,7 +27,9 @@ magic. */ use prelude::*; + use task::local_data_priv::{local_get, local_pop, local_modify, local_set, Handle}; +use task; /** * Indexes a task-local data slot. The function's code pointer is used for diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index b578084268a..64737c47f29 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -13,7 +13,9 @@ use libc::c_int; use num::{Zero, One, strconv}; use num::{FPCategory, FPNaN, FPInfinite , FPZero, FPSubnormal, FPNormal}; +use num; use prelude::*; +use to_str; pub use cmath::c_float_targ_consts::*; @@ -958,9 +960,12 @@ impl num::FromStrRadix for f32 { #[cfg(test)] mod tests { use f32::*; - use num::*; use prelude::*; + use num::*; + use num; + use sys; + #[test] fn test_num() { num::test_num(10f32, 2f32); diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index bca730c5748..f01d45bbd1d 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -13,7 +13,9 @@ use libc::c_int; use num::{Zero, One, strconv}; use num::{FPCategory, FPNaN, FPInfinite , FPZero, FPSubnormal, FPNormal}; +use num; use prelude::*; +use to_str; pub use cmath::c_double_targ_consts::*; pub use cmp::{min, max}; @@ -999,9 +1001,12 @@ impl num::FromStrRadix for f64 { #[cfg(test)] mod tests { use f64::*; - use num::*; use prelude::*; + use num::*; + use num; + use sys; + #[test] fn test_num() { num::test_num(10f64, 2f64); diff --git a/src/libstd/num/float.rs b/src/libstd/num/float.rs index acc5e5a6f39..30de95b4846 100644 --- a/src/libstd/num/float.rs +++ b/src/libstd/num/float.rs @@ -20,10 +20,13 @@ // PORT this must match in width according to architecture +use f64; use libc::c_int; use num::{Zero, One, strconv}; use num::FPCategory; +use num; use prelude::*; +use to_str; pub use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt}; pub use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor}; @@ -43,7 +46,7 @@ pub static neg_infinity: float = -1.0/0.0; pub mod consts { // FIXME (requires Issue #1433 to fix): replace with mathematical // staticants from cmath. - /// Archimedes' staticant + /// Archimedes' constant pub static pi: float = 3.14159265358979323846264338327950288; /// pi/2.0 @@ -945,10 +948,13 @@ impl Float for float { #[cfg(test)] mod tests { - use num::*; use super::*; use prelude::*; + use num::*; + use num; + use sys; + #[test] fn test_num() { num::test_num(10f, 2f); diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs index 27e872003ec..778e741ff3b 100644 --- a/src/libstd/num/int_macros.rs +++ b/src/libstd/num/int_macros.rs @@ -557,6 +557,13 @@ mod tests { use super::*; use prelude::*; + use i16; + use i32; + use i64; + use i8; + use num; + use sys; + #[test] fn test_num() { num::test_num(10 as $T, 2 as $T); diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs index e6267bfe9e1..f16b4f4a740 100644 --- a/src/libstd/num/uint_macros.rs +++ b/src/libstd/num/uint_macros.rs @@ -402,6 +402,14 @@ mod tests { use super::*; use prelude::*; + use num; + use sys; + use u16; + use u32; + use u64; + use u8; + use uint; + #[test] fn test_num() { num::test_num(10 as $T, 2 as $T); diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 9c8c2dbe4d7..c1b5c159a24 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -31,8 +31,10 @@ use io; use libc; use libc::{c_char, c_void, c_int, size_t}; use libc::{mode_t, FILE}; +use local_data; use option; use option::{Some, None}; +use os; use prelude::*; use ptr; use str; diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs index 58d0c40efa0..07864ce419e 100644 --- a/src/libstd/prelude.rs +++ b/src/libstd/prelude.rs @@ -10,8 +10,7 @@ //! The Rust prelude. Imported into every module by default. -/* Reexported core operators */ - +// Reexported core operators pub use either::{Either, Left, Right}; pub use kinds::{Const, Copy, Owned}; pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not}; @@ -21,12 +20,10 @@ pub use ops::{Shl, Shr, Index}; pub use option::{Option, Some, None}; pub use result::{Result, Ok, Err}; -/* Reexported functions */ - +// Reexported functions pub use io::{print, println}; -/* Reexported types and traits */ - +// Reexported types and traits pub use clone::{Clone, DeepClone}; pub use cmp::{Eq, ApproxEq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater, Equiv}; pub use char::Char; @@ -64,48 +61,7 @@ pub use vec::{ImmutableEqVector, ImmutableCopyableVector}; pub use vec::{OwnedVector, OwnedCopyableVector, MutableVector}; pub use io::{Reader, ReaderUtil, Writer, WriterUtil}; -/* Reexported runtime types */ +// Reexported runtime types pub use comm::{stream, Port, Chan, GenericChan, GenericSmartChan, GenericPort, Peekable}; pub use task::spawn; -/* Reexported modules */ - -pub use at_vec; -pub use bool; -pub use cast; -pub use char; -pub use cmp; -pub use either; -pub use f32; -pub use f64; -pub use float; -pub use i16; -pub use i32; -pub use i64; -pub use i8; -pub use int; -pub use io; -pub use iter; -pub use old_iter; -pub use libc; -pub use local_data; -pub use num; -pub use ops; -pub use option; -pub use os; -pub use path; -pub use comm; -pub use unstable; -pub use ptr; -pub use rand; -pub use result; -pub use str; -pub use sys; -pub use task; -pub use to_str; -pub use u16; -pub use u32; -pub use u64; -pub use u8; -pub use uint; -pub use vec; diff --git a/src/libstd/ptr.rs b/src/libstd/ptr.rs index 38d7095a366..65375e410a6 100644 --- a/src/libstd/ptr.rs +++ b/src/libstd/ptr.rs @@ -430,6 +430,11 @@ pub mod ptr_tests { use super::*; use prelude::*; + use cast; + use libc; + use str; + use vec; + #[test] fn test() { unsafe { @@ -522,18 +527,19 @@ pub mod ptr_tests { #[test] fn test_to_option() { - let p: *int = null(); - // FIXME (#6641): Usage of unsafe methods in safe code doesn't cause an error. - assert_eq!(p.to_option(), None); + unsafe { + let p: *int = null(); + assert_eq!(p.to_option(), None); - let q: *int = &2; - assert_eq!(q.to_option().unwrap(), &2); // FIXME (#6641) + let q: *int = &2; + assert_eq!(q.to_option().unwrap(), &2); - let p: *mut int = mut_null(); - assert_eq!(p.to_option(), None); // FIXME (#6641) + let p: *mut int = mut_null(); + assert_eq!(p.to_option(), None); - let q: *mut int = &mut 2; - assert_eq!(q.to_option().unwrap(), &2); // FIXME (#6641) + let q: *mut int = &mut 2; + assert_eq!(q.to_option().unwrap(), &2); + } } #[test] diff --git a/src/libstd/rand.rs b/src/libstd/rand.rs index 2bcc9c8bba2..2c8681ef288 100644 --- a/src/libstd/rand.rs +++ b/src/libstd/rand.rs @@ -40,10 +40,13 @@ fn main () { ~~~ */ - +use cast; +use cmp; use int; +use local_data; use prelude::*; use str; +use sys; use u32; use uint; use util; diff --git a/src/libstd/rand/distributions.rs b/src/libstd/rand/distributions.rs index 72cff5111e7..a66e35f68df 100644 --- a/src/libstd/rand/distributions.rs +++ b/src/libstd/rand/distributions.rs @@ -20,6 +20,7 @@ // Generating Random Variables"], but more robust. If one wanted, one // could implement VIZIGNOR the ZIGNOR paper for more speed. +use f64; use prelude::*; use rand::{Rng,Rand}; diff --git a/src/libstd/rt/io/flate.rs b/src/libstd/rt/io/flate.rs index db2683dc85d..0a9e0b1e38f 100644 --- a/src/libstd/rt/io/flate.rs +++ b/src/libstd/rt/io/flate.rs @@ -100,6 +100,8 @@ mod test { use super::super::mem::*; use super::super::Decorator; + use str; + #[test] #[ignore] fn smoke_test() { diff --git a/src/libstd/rt/io/mem.rs b/src/libstd/rt/io/mem.rs index b2701c1fdc3..bd9cff76e57 100644 --- a/src/libstd/rt/io/mem.rs +++ b/src/libstd/rt/io/mem.rs @@ -15,9 +15,10 @@ //! * Should probably have something like this for strings. //! * Should they implement Closable? Would take extra state. +use cmp::min; use prelude::*; use super::*; -use cmp::min; +use vec; /// Writes to an owned, growable byte vector pub struct MemWriter { diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index cf4967b12b3..12c683120c8 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -13,12 +13,14 @@ //! local storage, and logging. Even a 'freestanding' Rust would likely want //! to implement this. -use prelude::*; -use libc::{c_void, uintptr_t}; use cast::transmute; +use libc::{c_void, uintptr_t}; +use ptr; +use prelude::*; use rt::local::Local; -use super::local_heap::LocalHeap; use rt::logging::StdErrLogger; +use super::local_heap::LocalHeap; +use super::sched::Scheduler; pub struct Task { heap: LocalHeap, diff --git a/src/libstd/rt/uv/uvll.rs b/src/libstd/rt/uv/uvll.rs index ddc9040d730..6263fd47df6 100644 --- a/src/libstd/rt/uv/uvll.rs +++ b/src/libstd/rt/uv/uvll.rs @@ -31,7 +31,11 @@ use libc::{size_t, c_int, c_uint, c_void, c_char, uintptr_t}; use libc::{malloc, free}; +use libc; use prelude::*; +use ptr; +use str; +use vec; pub static UNKNOWN: c_int = -1; pub static OK: c_int = 0; diff --git a/src/libstd/run.rs b/src/libstd/run.rs index 3cdc5dcca07..7c73aca3af9 100644 --- a/src/libstd/run.rs +++ b/src/libstd/run.rs @@ -11,10 +11,11 @@ //! Process spawning. use cast; -use io; -use libc; -use libc::{pid_t, c_void, c_int}; use comm::{stream, SharedChan, GenericChan, GenericPort}; +use int; +use io; +use libc::{pid_t, c_void, c_int}; +use libc; use option::{Some, None}; use os; use prelude::*; @@ -463,6 +464,9 @@ fn spawn_process_os(prog: &str, args: &[~str], }; use libc::funcs::extra::msvcrt::get_osfhandle; + use sys; + use uint; + unsafe { let mut si = zeroed_startupinfo(); @@ -574,6 +578,8 @@ fn zeroed_process_information() -> libc::types::os::arch::extra::PROCESS_INFORMA #[cfg(windows)] pub fn make_command_line(prog: &str, args: &[~str]) -> ~str { + use uint; + let mut cmd = ~""; append_arg(&mut cmd, prog); for args.each |arg| { diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index f24d2327358..9c9a91f9548 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -33,17 +33,22 @@ * ~~~ */ +use prelude::*; + +use cast; use cell::Cell; use cmp::Eq; -use result::Result; use comm::{stream, Chan, GenericChan, GenericPort, Port}; -use prelude::*; +use comm; +use ptr; +use result::Result; use result; -use task::rt::{task_id, sched_id}; -use util; -use util::replace; -use unstable::finally::Finally; use rt::{context, OldTaskContext}; +use task::rt::{task_id, sched_id}; +use task; +use unstable::finally::Finally; +use util::replace; +use util; #[cfg(test)] use comm::SharedChan; diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index 56b1fb43ff1..0b345b88d62 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -72,12 +72,14 @@ #[doc(hidden)]; +use prelude::*; + use cast::transmute; use cast; use cell::Cell; use container::Map; use comm::{Chan, GenericChan}; -use prelude::*; +use comm; use ptr; use hashmap::HashSet; use task::local_data_priv::{local_get, local_set, OldHandle}; @@ -87,6 +89,7 @@ use task::{Failure, ManualThreads, PlatformThread, SchedOpts, SingleThreaded}; use task::{Success, TaskOpts, TaskResult, ThreadPerCore, ThreadPerTask}; use task::{ExistingScheduler, SchedulerHandle}; use task::unkillable; +use task; use uint; use util; use unstable::sync::{Exclusive, exclusive}; diff --git a/src/libstd/trie.rs b/src/libstd/trie.rs index 13b892e700e..1490841b7e6 100644 --- a/src/libstd/trie.rs +++ b/src/libstd/trie.rs @@ -10,8 +10,12 @@ //! An ordered map and set for integer keys implemented as a radix trie +use local_data; +use os; use prelude::*; +use uint; use util::{swap, replace}; +use vec; // FIXME: #5244: need to manually update the TrieNode constructor static SHIFT: uint = 4; diff --git a/src/libstd/unstable/mod.rs b/src/libstd/unstable/mod.rs index afdc22a1c63..1f73aa02b01 100644 --- a/src/libstd/unstable/mod.rs +++ b/src/libstd/unstable/mod.rs @@ -10,9 +10,11 @@ #[doc(hidden)]; -use libc; use comm::{GenericChan, GenericPort}; +use comm; +use libc; use prelude::*; +use ptr; use task; pub mod at_exit; diff --git a/src/libstd/unstable/sync.rs b/src/libstd/unstable/sync.rs index 734368c70c4..bee317a0b93 100644 --- a/src/libstd/unstable/sync.rs +++ b/src/libstd/unstable/sync.rs @@ -214,48 +214,52 @@ mod tests { #[test] fn exclusive_arc() { - let mut futures = ~[]; + unsafe { + let mut futures = ~[]; - let num_tasks = 10; - let count = 10; + let num_tasks = 10; + let count = 10; - let total = exclusive(~0); + let total = exclusive(~0); - for uint::range(0, num_tasks) |_i| { - let total = total.clone(); - let (port, chan) = comm::stream(); - futures.push(port); + for uint::range(0, num_tasks) |_i| { + let total = total.clone(); + let (port, chan) = comm::stream(); + futures.push(port); - do task::spawn || { - for uint::range(0, count) |_i| { - do total.with |count| { - **count += 1; + do task::spawn || { + for uint::range(0, count) |_i| { + do total.with |count| { + **count += 1; + } } + chan.send(()); } - chan.send(()); - } - }; + }; - for futures.each |f| { f.recv() } + for futures.each |f| { f.recv() } - do total.with |total| { - assert!(**total == num_tasks * count) - }; + do total.with |total| { + assert!(**total == num_tasks * count) + }; + } } #[test] #[should_fail] #[ignore(cfg(windows))] fn exclusive_poison() { - // Tests that if one task fails inside of an exclusive, subsequent - // accesses will also fail. - let x = exclusive(1); - let x2 = x.clone(); - do task::try || { - do x2.with |one| { - assert_eq!(*one, 2); + unsafe { + // Tests that if one task fails inside of an exclusive, subsequent + // accesses will also fail. + let x = exclusive(1); + let x2 = x.clone(); + do task::try || { + do x2.with |one| { + assert_eq!(*one, 2); + } + }; + do x.with |one| { + assert_eq!(*one, 1); } - }; - do x.with |one| { - assert_eq!(*one, 1); } } } diff --git a/src/libstd/util.rs b/src/libstd/util.rs index 9e7f18f446d..5539881a648 100644 --- a/src/libstd/util.rs +++ b/src/libstd/util.rs @@ -8,12 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -/*! - -Miscellaneous helpers for common patterns. - -*/ +//! Miscellaneous helpers for common patterns. +use cast; +use local_data; +use ptr; use prelude::*; use unstable::intrinsics; diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index 2d4bc9a8c49..2b8d8cb3d31 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -10,6 +10,7 @@ use core::prelude::*; +use core::str; use core::to_bytes; #[deriving(Eq)] diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index e3ef56541b8..48c2df5a894 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -22,7 +22,10 @@ use print::pprust; use visit; use syntax::parse::token::special_idents; +use core::cmp; use core::hashmap::HashMap; +use core::str; +use core::vec; pub enum path_elt { path_mod(ident), diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index ba56d544880..c8cac4ba2d7 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -14,11 +14,14 @@ use ast::*; use ast; use ast_util; use codemap::{span, spanned}; +use opt_vec; use parse::token; use visit; -use opt_vec; -use core::hashmap::HashMap; +use core::hashmap::HashMap; +use core::int; +use core::option; +use core::str; use core::to_bytes; pub fn path_name_i(idents: &[ident], intr: @token::ident_interner) -> ~str { diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 6ac743d3844..2da64563159 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -20,6 +20,7 @@ use diagnostic::span_handler; use parse::comments::{doc_comment_style, strip_doc_comment_decoration}; use core::hashmap::HashSet; +use core::vec; use extra; /* Constructors */ diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 42117e3b73c..aedf30127ad 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -23,7 +23,10 @@ source code snippets, etc. use core::prelude::*; +use core::cmp; +use core::str; use core::to_bytes; +use core::uint; use extra::serialize::{Encodable, Decodable, Encoder, Decoder}; pub trait Pos { diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 0057579c9b7..76ede098ac3 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -13,6 +13,10 @@ use core::prelude::*; use codemap::{Pos, span}; use codemap; +use core::io; +use core::str; +use core::uint; +use core::vec; use extra::term; pub type Emitter = @fn(cmsp: Option<(@codemap::CodeMap, span)>, diff --git a/src/libsyntax/ext/asm.rs b/src/libsyntax/ext/asm.rs index 05ac87adcc5..874c10fae5f 100644 --- a/src/libsyntax/ext/asm.rs +++ b/src/libsyntax/ext/asm.rs @@ -21,6 +21,9 @@ use ext::base::*; use parse; use parse::token; +use core::str; +use core::vec; + enum State { Asm, Outputs, diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 311636ee7c1..a9b12c16b31 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -20,6 +20,7 @@ use parse; use parse::token; use core::hashmap::HashMap; +use core::vec; // new-style macro! tt code: // diff --git a/src/libsyntax/ext/deriving/decodable.rs b/src/libsyntax/ext/deriving/decodable.rs index d1f1c4187d5..4ae4533956e 100644 --- a/src/libsyntax/ext/deriving/decodable.rs +++ b/src/libsyntax/ext/deriving/decodable.rs @@ -15,15 +15,17 @@ encodable.rs for more. use core::prelude::*; -use ast; use ast::*; +use ast; +use ast_util; +use codemap::{span, spanned}; use ext::base::ExtCtxt; use ext::build::AstBuilder; use ext::deriving::*; -use codemap::{span, spanned}; -use ast_util; use opt_vec; +use core::uint; + pub fn expand_deriving_decodable( cx: @ExtCtxt, span: span, diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs index e250f970e62..d4b3488cc4f 100644 --- a/src/libsyntax/ext/deriving/generic.rs +++ b/src/libsyntax/ext/deriving/generic.rs @@ -173,6 +173,9 @@ use ext::deriving::*; use codemap::{span,respan}; use opt_vec; +use core::uint; +use core::vec; + pub use self::ty::*; mod ty; diff --git a/src/libsyntax/ext/deriving/iter_bytes.rs b/src/libsyntax/ext/deriving/iter_bytes.rs index 401b91227fc..64ce6dfbc19 100644 --- a/src/libsyntax/ext/deriving/iter_bytes.rs +++ b/src/libsyntax/ext/deriving/iter_bytes.rs @@ -16,6 +16,8 @@ use ext::base::ExtCtxt; use ext::build::AstBuilder; use ext::deriving::generic::*; +use core::vec; + pub fn expand_deriving_iter_bytes(cx: @ExtCtxt, span: span, mitem: @meta_item, diff --git a/src/libsyntax/ext/deriving/mod.rs b/src/libsyntax/ext/deriving/mod.rs index 3159b6db0af..796ccd304ff 100644 --- a/src/libsyntax/ext/deriving/mod.rs +++ b/src/libsyntax/ext/deriving/mod.rs @@ -28,6 +28,9 @@ use codemap::span; use parse::token::special_idents::clownshoes_extensions; use opt_vec; +use core::uint; +use core::vec; + pub mod clone; pub mod iter_bytes; pub mod encodable; diff --git a/src/libsyntax/ext/deriving/rand.rs b/src/libsyntax/ext/deriving/rand.rs index d62e4972fd1..b2e039786ad 100644 --- a/src/libsyntax/ext/deriving/rand.rs +++ b/src/libsyntax/ext/deriving/rand.rs @@ -17,6 +17,8 @@ use ext::base::ExtCtxt; use ext::build::{AstBuilder, Duplicate}; use ext::deriving::generic::*; +use core::vec; + pub fn expand_deriving_rand(cx: @ExtCtxt, span: span, mitem: @meta_item, diff --git a/src/libsyntax/ext/env.rs b/src/libsyntax/ext/env.rs index 3e5fb939f62..4d074b4d0e6 100644 --- a/src/libsyntax/ext/env.rs +++ b/src/libsyntax/ext/env.rs @@ -22,6 +22,8 @@ use ext::base::*; use ext::base; use ext::build::AstBuilder; +use core::os; + pub fn expand_syntax_ext(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree]) -> base::MacResult { diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 7fa235fc334..89ed9b7294d 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -24,6 +24,8 @@ use fold::*; use parse; use parse::{parse_item_from_source_str}; +use core::vec; + pub fn expand_expr(extsbox: @mut SyntaxEnv, cx: @ExtCtxt, e: &expr_, diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index 2efed5780b4..65b29ecaa91 100644 --- a/src/libsyntax/ext/fmt.rs +++ b/src/libsyntax/ext/fmt.rs @@ -22,7 +22,9 @@ use ext::base::*; use ext::base; use ext::build::AstBuilder; +use core::option; use core::unstable::extfmt::ct::*; +use core::vec; pub fn expand_syntax_ext(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree]) -> base::MacResult { @@ -52,8 +54,11 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span, -> @ast::expr { fn make_path_vec(cx: @ExtCtxt, ident: &str) -> ~[ast::ident] { let intr = cx.parse_sess().interner; - return ~[intr.intern("unstable"), intr.intern("extfmt"), - intr.intern("rt"), intr.intern(ident)]; + return ~[intr.intern("std"), + intr.intern("unstable"), + intr.intern("extfmt"), + intr.intern("rt"), + intr.intern(ident)]; } fn make_rt_path_expr(cx: @ExtCtxt, sp: span, nm: &str) -> @ast::expr { let path = make_path_vec(cx, nm); @@ -252,6 +257,7 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span, /* 'ident' is the local buffer building up the result of fmt! */ let ident = cx.parse_sess().interner.intern("__fmtbuf"); let buf = || cx.expr_ident(fmt_sp, ident); + let core_ident = cx.parse_sess().interner.intern("std"); let str_ident = cx.parse_sess().interner.intern("str"); let push_ident = cx.parse_sess().interner.intern("push_str"); let mut stms = ~[]; @@ -273,7 +279,9 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span, } else { let args = ~[cx.expr_mut_addr_of(fmt_sp, buf()), cx.expr_str(fmt_sp, s)]; let call = cx.expr_call_global(fmt_sp, - ~[str_ident, push_ident], + ~[core_ident, + str_ident, + push_ident], args); stms.push(cx.stmt_expr(call)); } diff --git a/src/libsyntax/ext/log_syntax.rs b/src/libsyntax/ext/log_syntax.rs index 423ade835a0..95cf4a18ab4 100644 --- a/src/libsyntax/ext/log_syntax.rs +++ b/src/libsyntax/ext/log_syntax.rs @@ -16,6 +16,9 @@ use ext::base::*; use ext::base; use print; +use core::io; +use core::vec; + pub fn expand_syntax_ext(cx: @ExtCtxt, sp: codemap::span, tt: &[ast::token_tree]) diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index da59059a0cc..37d5e0206cb 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -19,6 +19,9 @@ use ast::ident; use ast; use codemap::span; +use core::str; +use core::vec; + // Transitional reexports so qquote can find the paths it is looking for mod syntax { pub use ext; diff --git a/src/libsyntax/ext/pipes/liveness.rs b/src/libsyntax/ext/pipes/liveness.rs index f1f5a7f12b2..43bcb68b8e0 100644 --- a/src/libsyntax/ext/pipes/liveness.rs +++ b/src/libsyntax/ext/pipes/liveness.rs @@ -42,6 +42,7 @@ use core::prelude::*; use ext::base::ExtCtxt; use ext::pipes::proto::{protocol_}; +use core::str; use extra::bitv::Bitv; pub fn analyze(proto: @mut protocol_, _cx: @ExtCtxt) { diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index e55ecbc29bc..db0efdd7b0f 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -23,6 +23,9 @@ use ext::quote::rt::*; use opt_vec; use opt_vec::OptVec; +use core::str; +use core::vec; + pub trait gen_send { fn gen_send(&mut self, cx: @ExtCtxt, try: bool) -> @ast::item; fn to_ty(&mut self, cx: @ExtCtxt) -> @ast::Ty; diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 9a5645a5b0c..9182b99bf30 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -19,6 +19,8 @@ use parse::token::*; use parse::token; use parse; +use core::vec; + /** * * Quasiquoting works via token trees. diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index 73b84c2a5ab..8a60b239b89 100644 --- a/src/libsyntax/ext/source_util.rs +++ b/src/libsyntax/ext/source_util.rs @@ -20,6 +20,11 @@ use ext::build::AstBuilder; use parse; use print::pprust; +use core::io; +use core::result; +use core::str; +use core::vec; + // These macros all relate to the file system; they either return // the column/row/filename of the expression, or they include // a given file into the current one. diff --git a/src/libsyntax/ext/trace_macros.rs b/src/libsyntax/ext/trace_macros.rs index f899004de5c..111e176d4c5 100644 --- a/src/libsyntax/ext/trace_macros.rs +++ b/src/libsyntax/ext/trace_macros.rs @@ -18,6 +18,8 @@ use parse::lexer::{new_tt_reader, reader}; use parse::parser::Parser; use parse::token::keywords; +use core::vec; + pub fn expand_trace_macros(cx: @ExtCtxt, sp: span, tt: &[ast::token_tree]) diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index be79722373b..183bc2a77c5 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -23,6 +23,9 @@ use parse::token::{Token, EOF, to_str, nonterminal}; use parse::token; use core::hashmap::HashMap; +use core::str; +use core::uint; +use core::vec; /* This is an Earley-like parser, without support for in-grammar nonterminals, only by calling out to the main rust parser for named nonterminals (which it diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 04ac311579f..261943132b3 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -26,6 +26,7 @@ use parse::token::{FAT_ARROW, SEMI, nt_matchers, nt_tt}; use print; use core::io; +use core::vec; pub fn add_new_extension(cx: @ExtCtxt, sp: span, diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index 3e63360fbec..cac963727e3 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -19,6 +19,8 @@ use parse::token::{EOF, INTERPOLATED, IDENT, Token, nt_ident, ident_interner}; use parse::lexer::TokenAndSpan; use core::hashmap::HashMap; +use core::option; +use core::vec; ///an unzipping of `token_tree`s struct TtFrame { diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 0d863c736ed..27a10c36ead 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -15,6 +15,8 @@ use ast; use codemap::{span, spanned}; use opt_vec::OptVec; +use core::vec; + pub trait ast_fold { fn fold_crate(@self, &crate) -> crate; fn fold_view_item(@self, @view_item) -> @view_item; diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 3fa0fa3b0f0..001a693d1ae 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -20,6 +20,10 @@ use parse::lexer; use parse::token; use parse; +use core::io; +use core::str; +use core::uint; + #[deriving(Eq)] pub enum cmnt_style { isolated, // No code on either side of each line of the comment diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index eabe664d8ef..4a9ef2faa54 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -18,6 +18,11 @@ use ext::tt::transcribe::{tt_next_token}; use ext::tt::transcribe::{dup_tt_reader}; use parse::token; +use core::char; +use core::either; +use core::str; +use core::u64; + pub use ext::tt::transcribe::{TtReader, new_tt_reader}; pub trait reader { diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index 9a8001386ab..085d24d7e68 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -26,6 +26,7 @@ use parse::parser::Parser; use parse::token::{keywords, Token}; use parse::token; +use core::str; use core::to_bytes; /// The specific types of unsupported syntax diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index de93bb3712b..27dfc2c0a46 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -92,9 +92,11 @@ use parse::{new_sub_parser_from_file, next_node_id, ParseSess}; use opt_vec; use opt_vec::OptVec; +use core::char; use core::either::Either; use core::either; use core::hashmap::HashSet; +use core::str; use core::vec; #[deriving(Eq)] diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index a4b3783f22d..b1a385ada07 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -16,8 +16,14 @@ use parse::token; use util::interner::StrInterner; use util::interner; +use core::cast; +use core::char; use core::cmp::Equiv; +use core::hashmap::HashSet; +use core::local_data; +use core::str; use core::to_bytes; +use core::vec; #[deriving(Encodable, Decodable, Eq)] pub enum binop { diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index d3b5c751e69..11830dc3c29 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -63,6 +63,9 @@ use core::prelude::*; +use core::io; +use core::vec; + #[deriving(Eq)] pub enum breaks { consistent, inconsistent, } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 5f814cc3576..6a32e535295 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -29,6 +29,13 @@ use print::pp::{breaks, consistent, inconsistent, eof}; use print::pp; use print::pprust; +use core::char; +use core::io; +use core::str; +use core::u64; +use core::uint; +use core::vec; + // The @ps is stored here to prevent recursive type. pub enum ann_node<'self> { node_block(@ps, &'self ast::blk), diff --git a/src/libsyntax/syntax.rc b/src/libsyntax/syntax.rc index cb1c2269c1e..78fbcab213c 100644 --- a/src/libsyntax/syntax.rc +++ b/src/libsyntax/syntax.rc @@ -35,6 +35,12 @@ extern mod std(name = "extra"); #[cfg(not(stage0))] extern mod std(name = "std"); +// For bootstrapping purposes. +#[cfg(stage0)] +pub use core::str; +#[cfg(stage0)] +pub use core::unstable; + use core::prelude::*; pub mod util { 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(x: T) -> Port { 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; } 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 std::cell::Cell; -use std::pipes::recv; -use std::util; -use extra::time; 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; 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 std::cell::Cell; -use std::pipes::*; use extra::time::precise_time_s; +use std::cell::Cell; +use std::io; +use std::os; +use std::pipes::*; +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, 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) { 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>>) { 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 = 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 for Point { +impl Add 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 or the MIT license -// , 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(o: &mut Option) { - assert!(*o == option::None); + assert!(*o == None); } fn main() { - f::(&mut option::None); + f::(&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 { f: A } fn guard(_s: ~str) -> bool {fail!()} fn touch(_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); 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 { 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::) { - (option::Some(_), _) => { fail!("squirrelcupcake"); } - (_, option::Some(_)) => { fail!(); } + match (Some('a'), None::) { + (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::(~"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 { 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) { - io::println(x.get().to_str()); + println(x.get().to_str()); } fn f(x: &mut Option) { 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::(); rand::random::(); } -} \ 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 { #[unsafe_destructor] impl ::std::ops::Drop for S { 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 { fn foo(&self) -> Option; 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(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); 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 { fn flat_map_to_vec>(&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 { 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: T) { } +fn foo(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 { 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 { fn bind(&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 ToStr for PolymorphicThingy { } 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 { Thing(int, T), Nothing((), ((), ()), [i8, ..0]) } struct S(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 { 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 { 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::(), 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(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: 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; 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>) { 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>) { 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, 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, 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, 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, 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, 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::(); 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(n: T) { io::println(fmt!("%?", n < n)) } +fn test_float_ext(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(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 { @@ -58,4 +61,4 @@ pub fn main() { assert!(compare::(6.19)); assert!(!compare::(7.28318530717958647692528676655900576)); assert!(!compare::(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 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 { fn new() -> T; } @@ -21,7 +23,7 @@ mod base { impl ::base::HasNew 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 { 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, 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;