diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-01-08 19:29:16 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-01-08 19:29:16 -0800 |
| commit | 44ab00ee37c4ffb8440ff20fd8a15cd24a6f3e46 (patch) | |
| tree | 83f3d67a9e21c6ce1b99c2ce8f6a737896c673db /src | |
| parent | a8d37af2473da79be704c9ce2374f278c47177b6 (diff) | |
| download | rust-44ab00ee37c4ffb8440ff20fd8a15cd24a6f3e46.tar.gz rust-44ab00ee37c4ffb8440ff20fd8a15cd24a6f3e46.zip | |
Revert "librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc"
This reverts commit a8d37af2473da79be704c9ce2374f278c47177b6.
Diffstat (limited to 'src')
249 files changed, 448 insertions, 1337 deletions
diff --git a/src/compiletest/common.rs b/src/compiletest/common.rs index 5b93c55ddc6..136f40c9c20 100644 --- a/src/compiletest/common.rs +++ b/src/compiletest/common.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use cmp; enum mode { mode_compile_fail, mode_run_fail, mode_run_pass, mode_pretty, } diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 54723253141..62961f6c6e4 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use common::config; use io; use io::ReaderUtil; diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index 9fe5d9acb9b..730e863d04d 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use common; use common::config; use io; diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs index b3884917389..666deeca191 100644 --- a/src/compiletest/procsrv.rs +++ b/src/compiletest/procsrv.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use io; use io::{ReaderUtil, WriterUtil}; use libc; diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index d7810ced2b6..a7dbfb9a3b2 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use io; use io::WriterUtil; use os; diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs index 13614c58855..fe3bf4672c7 100644 --- a/src/compiletest/util.rs +++ b/src/compiletest/util.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use io; use os; use os::getenv; diff --git a/src/libcargo/pgp.rs b/src/libcargo/pgp.rs index 829a82baf7f..e05260bace2 100644 --- a/src/libcargo/pgp.rs +++ b/src/libcargo/pgp.rs @@ -9,7 +9,6 @@ // except according to those terms. use core::os; -use core::path::Path; use core::run; fn gpgv(args: ~[~str]) -> { status: int, out: ~str, err: ~str } { diff --git a/src/libcore/at_vec.rs b/src/libcore/at_vec.rs index d78d241d2b1..4f3f63c83fc 100644 --- a/src/libcore/at_vec.rs +++ b/src/libcore/at_vec.rs @@ -15,10 +15,8 @@ #[forbid(deprecated_pattern)]; use cast::transmute; -use kinds::Copy; use iter; use libc; -use option::Option; use ptr::addr_of; use sys; use uint; @@ -152,10 +150,6 @@ pub pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] { #[cfg(notest)] pub mod traits { - use at_vec::append; - use kinds::Copy; - use ops::Add; - pub impl<T: Copy> @[T] : Add<&[const T],@[T]> { #[inline(always)] pure fn add(&self, rhs: & &self/[const T]) -> @[T] { @@ -168,10 +162,8 @@ pub mod traits { pub mod traits {} pub mod raw { - use at_vec::{capacity, rusti, rustrt}; - use cast::transmute; + use at_vec::{rusti, rustrt}; use libc; - use ptr::addr_of; use ptr; use sys; use uint; diff --git a/src/libcore/bool.rs b/src/libcore/bool.rs index 3e7b88b7b78..3181cb24ea7 100644 --- a/src/libcore/bool.rs +++ b/src/libcore/bool.rs @@ -19,7 +19,6 @@ use bool; use cmp; use cmp::Eq; -use option::{None, Option, Some}; /// Negation / inverse pub pure fn not(v: bool) -> bool { !v } diff --git a/src/libcore/cast.rs b/src/libcore/cast.rs index 950a753d73f..4ae89191545 100644 --- a/src/libcore/cast.rs +++ b/src/libcore/cast.rs @@ -108,8 +108,6 @@ pub unsafe fn copy_lifetime_vec<S,T>(_ptr: &a/[S], ptr: &T) -> &a/T { #[cfg(test)] pub mod tests { - use cast::{bump_box_refcount, reinterpret_cast, transmute}; - #[test] pub fn test_reinterpret_cast() { assert 1u == unsafe { reinterpret_cast(&1) }; diff --git a/src/libcore/char.rs b/src/libcore/char.rs index 8403c621608..4fe60810dc3 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -16,7 +16,6 @@ use char; use cmp::Eq; -use option::{None, Option, Some}; use str; use u32; use uint; diff --git a/src/libcore/condition.rs b/src/libcore/condition.rs index a40121445fa..9ea48a45d3c 100644 --- a/src/libcore/condition.rs +++ b/src/libcore/condition.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use prelude::*; use task; use task::local_data::{local_data_pop, local_data_set}; diff --git a/src/libcore/core.rc b/src/libcore/core.rc index b422d76e02d..13e0e300242 100644 --- a/src/libcore/core.rc +++ b/src/libcore/core.rc @@ -53,9 +53,6 @@ Implicitly, all crates behave as if they included the following prologue: #[warn(vecs_implicitly_copyable)]; #[deny(non_camel_case_types)]; -/* The Prelude. */ - -pub mod prelude; /* Primitive types */ @@ -246,8 +243,6 @@ pub mod core { pub use cmp; pub use condition; - pub use option; - pub use kinds; } diff --git a/src/libcore/dlist.rs b/src/libcore/dlist.rs index 1aa6c5a0197..89789a38b24 100644 --- a/src/libcore/dlist.rs +++ b/src/libcore/dlist.rs @@ -22,9 +22,7 @@ Do not use ==, !=, <, etc on doubly-linked lists -- it may not terminate. #[forbid(deprecated_mode)]; #[forbid(deprecated_pattern)]; -use kinds::Copy; use managed; -use option::{None, Option, Some}; use option; use vec; @@ -96,13 +94,13 @@ impl<T> DListNode<T> { } /// Creates a new dlist node with the given data. -pub pure fn new_dlist_node<T>(data: T) -> DListNode<T> { +pure fn new_dlist_node<T>(data: T) -> DListNode<T> { DListNode(@{data: move data, mut linked: false, mut prev: None, mut next: None}) } /// Creates a new, empty dlist. -pub pure fn DList<T>() -> DList<T> { +pure fn DList<T>() -> DList<T> { DList_(@{mut size: 0, mut hd: None, mut tl: None}) } @@ -122,7 +120,7 @@ pub fn from_vec<T: Copy>(vec: &[T]) -> DList<T> { /// Produce a list from a list of lists, leaving no elements behind in the /// input. O(number of sub-lists). -pub fn concat<T>(lists: DList<DList<T>>) -> DList<T> { +fn concat<T>(lists: DList<DList<T>>) -> DList<T> { let result = DList(); while !lists.is_empty() { result.append(lists.pop().get()); @@ -476,9 +474,7 @@ impl<T: Copy> DList<T> { mod tests { #[legacy_exports]; - use dlist::{DList, concat, from_vec, new_dlist_node}; use iter; - use option::{None, Some}; use vec; #[test] diff --git a/src/libcore/dvec.rs b/src/libcore/dvec.rs index 92ac1faf306..dd6b0721121 100644 --- a/src/libcore/dvec.rs +++ b/src/libcore/dvec.rs @@ -25,7 +25,6 @@ Note that recursive use is not permitted. use cast; use cast::reinterpret_cast; -use prelude::*; use ptr::null; use vec; diff --git a/src/libcore/either.rs b/src/libcore/either.rs index 4902edcedb1..b2c70916a00 100644 --- a/src/libcore/either.rs +++ b/src/libcore/either.rs @@ -14,11 +14,10 @@ //! A type that represents one of two alternatives -use cmp::Eq; use cmp; -use kinds::Copy; -use result::Result; +use cmp::Eq; use result; +use result::Result; use vec; /// The either type diff --git a/src/libcore/extfmt.rs b/src/libcore/extfmt.rs index 474e4ae77bb..312fc18a033 100644 --- a/src/libcore/extfmt.rs +++ b/src/libcore/extfmt.rs @@ -82,7 +82,6 @@ debug!("hello, %s!", "world"); use cmp::Eq; use option::{Some, None}; -use prelude::*; use str; /* @@ -100,7 +99,6 @@ use str; #[doc(hidden)] pub mod ct { use char; - use prelude::*; use str; use vec; diff --git a/src/libcore/float.rs b/src/libcore/float.rs index 3e521764723..34269b88748 100644 --- a/src/libcore/float.rs +++ b/src/libcore/float.rs @@ -31,7 +31,6 @@ use cmp; use f64; use num; use num::Num::from_int; -use option::{None, Option, Some}; use str; use uint; diff --git a/src/libcore/gc.rs b/src/libcore/gc.rs index bab0c710c3a..89f5a4eb8f0 100644 --- a/src/libcore/gc.rs +++ b/src/libcore/gc.rs @@ -42,7 +42,6 @@ with destructors. use cast; use io; use libc::{size_t, uintptr_t}; -use option::{None, Option, Some}; use ptr; use send_map::linear::LinearMap; use stackwalk; diff --git a/src/libcore/int-template.rs b/src/libcore/int-template.rs index 4946a0997c1..d04123fdb2b 100644 --- a/src/libcore/int-template.rs +++ b/src/libcore/int-template.rs @@ -21,7 +21,6 @@ use from_str::FromStr; use iter; use num; use num::Num::from_int; -use prelude::*; use str; use uint; use vec; diff --git a/src/libcore/int-template/int.rs b/src/libcore/int-template/int.rs index 224da0dc062..9e06cc95270 100644 --- a/src/libcore/int-template/int.rs +++ b/src/libcore/int-template/int.rs @@ -50,8 +50,8 @@ mod inst { #[test] fn test_overflows() { - assert (::int::max_value > 0); - assert (::int::min_value <= 0); - assert (::int::min_value + ::int::max_value + 1 == 0); + assert (max_value > 0); + assert (min_value <= 0); + assert (min_value + max_value + 1 == 0); } } diff --git a/src/libcore/io.rs b/src/libcore/io.rs index e0065f9c1e8..ade4f9d7fc8 100644 --- a/src/libcore/io.rs +++ b/src/libcore/io.rs @@ -28,7 +28,6 @@ use libc::consts::os::posix88::*; use libc::consts::os::extra::*; use option; use os; -use prelude::*; use ptr; use result; use str; @@ -36,7 +35,7 @@ use uint; use vec; #[allow(non_camel_case_types)] // not sure what to do about this -pub type fd_t = c_int; +type fd_t = c_int; #[abi = "cdecl"] extern mod rustrt { @@ -453,12 +452,12 @@ impl<T: Reader, C> {base: T, cleanup: C}: Reader { fn tell(&self) -> uint { self.base.tell() } } -pub struct FILERes { +struct FILERes { f: *libc::FILE, drop { libc::fclose(self.f); } } -pub fn FILERes(f: *libc::FILE) -> FILERes { +fn FILERes(f: *libc::FILE) -> FILERes { FILERes { f: f } @@ -630,12 +629,12 @@ impl fd_t: Writer { } } -pub struct FdRes { +struct FdRes { fd: fd_t, drop { libc::close(self.fd); } } -pub fn FdRes(fd: fd_t) -> FdRes { +fn FdRes(fd: fd_t) -> FdRes { FdRes { fd: fd } @@ -1029,10 +1028,7 @@ pub fn read_whole_file(file: &Path) -> Result<~[u8], ~str> { // fsync related pub mod fsync { - use io::{FILERes, FdRes, fd_t}; - use kinds::Copy; use libc; - use option::Option; use option; use os; @@ -1117,11 +1113,8 @@ pub mod fsync { #[cfg(test)] mod tests { - use debug; use i32; - use io::{BytesWriter, SeekCur, SeekEnd, SeekSet}; use io; - use path::Path; use result; use str; use u64; diff --git a/src/libcore/iter-trait.rs b/src/libcore/iter-trait.rs index a139daddcef..59eb9fbae8e 100644 --- a/src/libcore/iter-trait.rs +++ b/src/libcore/iter-trait.rs @@ -16,10 +16,7 @@ #[forbid(deprecated_pattern)]; use cmp::{Eq, Ord}; -use iter::BaseIter; use iter; -use kinds::Copy; -use option::Option; use self::inst::{IMPL_T, EACH, SIZE_HINT}; diff --git a/src/libcore/iter-trait/dlist.rs b/src/libcore/iter-trait/dlist.rs index eb395c57ae8..42ed4b5f73c 100644 --- a/src/libcore/iter-trait/dlist.rs +++ b/src/libcore/iter-trait/dlist.rs @@ -11,7 +11,6 @@ mod inst { use dlist; use managed; - use option::{Option, Some}; use option; #[allow(non_camel_case_types)] diff --git a/src/libcore/iter-trait/dvec.rs b/src/libcore/iter-trait/dvec.rs index 28d1cf03d46..f338578d143 100644 --- a/src/libcore/iter-trait/dvec.rs +++ b/src/libcore/iter-trait/dvec.rs @@ -10,7 +10,6 @@ mod inst { use dvec; - use option::{Option, Some}; #[allow(non_camel_case_types)] pub type IMPL_T<A> = dvec::DVec<A>; diff --git a/src/libcore/iter-trait/option.rs b/src/libcore/iter-trait/option.rs index 2240db82f29..a3a18a5509a 100644 --- a/src/libcore/iter-trait/option.rs +++ b/src/libcore/iter-trait/option.rs @@ -9,8 +9,6 @@ // except according to those terms. mod inst { - use option::{None, Option, Some}; - #[allow(non_camel_case_types)] pub type IMPL_T<A> = Option<A>; @@ -27,4 +25,4 @@ mod inst { Some(_) => Some(1) } } -} +} \ No newline at end of file diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 1e56b0f14af..db82fa14950 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -18,8 +18,6 @@ The iteration traits and common implementation #[forbid(deprecated_pattern)]; use cmp::{Eq, Ord}; -use kinds::Copy; -use option::{None, Option, Some}; use vec; /// A function used to initialize the elements of a sequence diff --git a/src/libcore/libc.rs b/src/libcore/libc.rs index 8e468bab15d..ae29bbe3085 100644 --- a/src/libcore/libc.rs +++ b/src/libcore/libc.rs @@ -164,7 +164,7 @@ pub use libc::funcs::posix88::unistd::{getpid, isatty, lseek, pipe, read}; pub use libc::funcs::posix88::unistd::{rmdir, unlink, write}; -pub mod types { +mod types { // Types tend to vary *per architecture* so we pull their definitions out // into this module. @@ -230,8 +230,6 @@ pub mod types { pub type uintptr_t = uint; } pub mod posix88 { - use prelude::*; - pub type off_t = i32; pub type dev_t = u64; pub type ino_t = u32; @@ -530,6 +528,33 @@ pub mod types { pub mod os { pub mod common { pub mod posix01 { + pub type nlink_t = u16; + pub type blksize_t = i64; + pub type blkcnt_t = i32; + pub struct stat { + st_dev: dev_t, + st_mode: mode_t, + st_nlink: nlink_t, + st_ino: ino_t, + st_uid: uid_t, + st_gid: gid_t, + st_rdev: dev_t, + st_atime: time_t, + st_atime_nsec: c_long, + st_mtime: time_t, + st_mtime_nsec: c_long, + st_ctime: time_t, + st_ctime_nsec: c_long, + st_birthtime: time_t, + st_birthtime_nsec: c_long, + st_size: off_t, + st_blocks: blkcnt_t, + st_blksize: blksize_t, + st_flags: uint32_t, + st_gen: uint32_t, + st_lspare: int32_t, + st_qspare: [int64_t * 2], + } } } @@ -571,34 +596,6 @@ pub mod types { pub type ssize_t = i32; } pub mod posix01 { - pub type nlink_t = u16; - pub type blksize_t = i64; - pub type blkcnt_t = i32; - - pub struct stat { - st_dev: dev_t, - st_mode: mode_t, - st_nlink: nlink_t, - st_ino: ino_t, - st_uid: uid_t, - st_gid: gid_t, - st_rdev: dev_t, - st_atime: time_t, - st_atime_nsec: c_long, - st_mtime: time_t, - st_mtime_nsec: c_long, - st_ctime: time_t, - st_ctime_nsec: c_long, - st_birthtime: time_t, - st_birthtime_nsec: c_long, - st_size: off_t, - st_blocks: blkcnt_t, - st_blksize: blksize_t, - st_flags: uint32_t, - st_gen: uint32_t, - st_lspare: int32_t, - st_qspare: [int64_t * 2], - } } pub mod posix08 { } @@ -646,40 +643,6 @@ pub mod types { pub type ssize_t = i64; } pub mod posix01 { - use libc::types::common::c99::{int32_t, int64_t}; - use libc::types::common::c99::{uint32_t}; - use libc::types::os::arch::c95::{c_long, time_t}; - use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t}; - use libc::types::os::arch::posix88::{mode_t, off_t, uid_t}; - - pub type nlink_t = u16; - pub type blksize_t = i64; - pub type blkcnt_t = i32; - - pub struct stat { - st_dev: dev_t, - st_mode: mode_t, - st_nlink: nlink_t, - st_ino: ino_t, - st_uid: uid_t, - st_gid: gid_t, - st_rdev: dev_t, - st_atime: time_t, - st_atime_nsec: c_long, - st_mtime: time_t, - st_mtime_nsec: c_long, - st_ctime: time_t, - st_ctime_nsec: c_long, - st_birthtime: time_t, - st_birthtime_nsec: c_long, - st_size: off_t, - st_blocks: blkcnt_t, - st_blksize: blksize_t, - st_flags: uint32_t, - st_gen: uint32_t, - st_lspare: int32_t, - st_qspare: [int64_t * 2], - } } pub mod posix08 { } @@ -971,11 +934,6 @@ pub mod funcs { // or anything. The same is not true of POSIX. pub mod c95 { - use libc::types::common::c95::{FILE, c_void, fpos_t}; - use libc::types::common::posix88::dirent_t; - use libc::types::os::arch::c95::{c_char, c_double, c_int, c_long}; - use libc::types::os::arch::c95::{c_uint, c_ulong, c_void, size_t}; - #[nolink] #[abi = "cdecl"] pub extern mod ctype { @@ -1216,14 +1174,6 @@ pub mod funcs { #[cfg(target_os = "macos")] #[cfg(target_os = "freebsd")] pub mod posix88 { - use libc::types::common::c95::{FILE, c_void}; - use libc::types::common::posix88::{DIR, dirent_t}; - use libc::types::os::arch::c95::{c_char, c_int, c_long, c_uint}; - use libc::types::os::arch::c95::{size_t}; - use libc::types::os::arch::posix01::stat; - use libc::types::os::arch::posix88::{gid_t, mode_t, off_t, pid_t}; - use libc::types::os::arch::posix88::{ssize_t, uid_t}; - #[nolink] #[abi = "cdecl"] pub extern mod stat_ { @@ -1332,10 +1282,6 @@ pub mod funcs { #[cfg(target_os = "macos")] #[cfg(target_os = "freebsd")] pub mod posix01 { - use libc::types::os::arch::c95::{c_char, c_int, size_t}; - use libc::types::os::arch::posix01::stat; - use libc::types::os::arch::posix88::{pid_t, ssize_t}; - #[nolink] #[abi = "cdecl"] pub extern mod stat_ { @@ -1403,9 +1349,6 @@ pub mod funcs { #[nolink] #[abi = "cdecl"] pub extern mod bsd44 { - use libc::types::common::c95::{c_void}; - use libc::types::os::arch::c95::{c_char, c_int, c_uint, size_t}; - fn sysctl(name: *c_int, namelen: c_uint, oldp: *mut c_void, oldlenp: *mut size_t, newp: *c_void, newlen: size_t) -> c_int; @@ -1428,8 +1371,6 @@ pub mod funcs { #[nolink] #[abi = "cdecl"] pub extern mod extra { - use libc::types::os::arch::c95::{c_char, c_int}; - fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32) -> c_int; } diff --git a/src/libcore/managed.rs b/src/libcore/managed.rs index b334d246743..5bbb5f6bec2 100644 --- a/src/libcore/managed.rs +++ b/src/libcore/managed.rs @@ -15,12 +15,10 @@ #[forbid(deprecated_pattern)]; use cmp::{Eq, Ord}; -use prelude::*; +use intrinsic::TyDesc; use ptr; pub mod raw { - use intrinsic::TyDesc; - pub struct BoxHeaderRepr { ref_count: uint, type_desc: *TyDesc, diff --git a/src/libcore/oldcomm.rs b/src/libcore/oldcomm.rs index 4425858bcff..2ce2c323cbf 100644 --- a/src/libcore/oldcomm.rs +++ b/src/libcore/oldcomm.rs @@ -52,13 +52,11 @@ use either::Either; use iter; use libc; use libc::size_t; -use prelude::*; use ptr; use result; use sys; use task; use vec; - // After snapshot, change p2::addr_of => addr_of /** diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 49ba10dfffb..a46736055a0 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -45,7 +45,6 @@ let unwrapped_msg = match move msg { #[forbid(deprecated_pattern)]; use cmp::Eq; -use kinds::Copy; use option; use ptr; use str; diff --git a/src/libcore/os.rs b/src/libcore/os.rs index 587d684c60c..b42d6d363e3 100644 --- a/src/libcore/os.rs +++ b/src/libcore/os.rs @@ -38,7 +38,6 @@ use libc::{c_char, c_void, c_int, c_uint, size_t, ssize_t}; use libc::{mode_t, pid_t, FILE}; use option; use option::{Some, None}; -use prelude::*; use private; use ptr; use str; @@ -145,7 +144,6 @@ mod global_env { use either; use libc; use oldcomm; - use option::Option; use private; use str; use task; @@ -219,7 +217,6 @@ mod global_env { mod impl_ { use cast; use libc; - use option::Option; use option; use ptr; use str; @@ -783,7 +780,7 @@ unsafe fn load_argc_and_argv(argc: c_int, argv: **c_char) -> ~[~str] { * Returns a list of the command line arguments. */ #[cfg(target_os = "macos")] -pub fn real_args() -> ~[~str] { +fn real_args() -> ~[~str] { unsafe { let (argc, argv) = (*_NSGetArgc() as c_int, *_NSGetArgv() as **c_char); @@ -793,7 +790,7 @@ pub fn real_args() -> ~[~str] { #[cfg(target_os = "linux")] #[cfg(target_os = "freebsd")] -pub fn real_args() -> ~[~str] { +fn real_args() -> ~[~str] { unsafe { let argc = rustrt::rust_get_argc(); let argv = rustrt::rust_get_argv(); @@ -802,7 +799,7 @@ pub fn real_args() -> ~[~str] { } #[cfg(windows)] -pub fn real_args() -> ~[~str] { +fn real_args() -> ~[~str] { let mut nArgs: c_int = 0; let lpArgCount = ptr::to_mut_unsafe_ptr(&mut nArgs); let lpCmdLine = GetCommandLineW(); @@ -876,7 +873,7 @@ extern { pub fn _NSGetArgv() -> ***c_char; } -pub mod consts { +mod consts { #[cfg(unix)] use os::consts::unix::*; @@ -957,15 +954,9 @@ pub mod consts { #[cfg(test)] #[allow(non_implicitly_copyable_typarams)] mod tests { - use debug; - use libc::{c_int, c_void, size_t}; use libc; - use option::{None, Option, Some}; use option; - use os::{as_c_charp, env, getcwd, getenv, make_absolute, real_args}; - use os::{remove_file, setenv}; use os; - use path::Path; use rand; use run; use str; @@ -973,7 +964,7 @@ mod tests { #[test] pub fn last_os_error() { - log(debug, os::last_os_error()); + log(debug, last_os_error()); } #[test] diff --git a/src/libcore/path.rs b/src/libcore/path.rs index d1d7d00bab8..115983e5fdb 100644 --- a/src/libcore/path.rs +++ b/src/libcore/path.rs @@ -20,10 +20,8 @@ Cross-platform file path handling use cmp::Eq; use libc; -use option::{None, Option, Some}; use ptr; use str; -use to_str::ToStr; #[deriving_eq] pub struct WindowsPath { @@ -753,8 +751,6 @@ pub pure fn normalize(components: &[~str]) -> ~[~str] { // Various windows helpers, and tests for the impl. pub mod windows { use libc; - use option::{None, Option, Some}; - use to_str::ToStr; #[inline(always)] pub pure fn is_sep(u: u8) -> bool { @@ -797,8 +793,7 @@ pub mod windows { #[cfg(test)] mod tests { - use option::{None, Some}; - use path::{PosixPath, WindowsPath, windows}; + use path::windows; use str; #[test] diff --git a/src/libcore/pipes.rs b/src/libcore/pipes.rs index 260bc7e2476..a129a9f4c5a 100644 --- a/src/libcore/pipes.rs +++ b/src/libcore/pipes.rs @@ -90,13 +90,11 @@ bounded and unbounded protocols allows for less code duplication. use cmp::Eq; use cast::{forget, reinterpret_cast, transmute}; use either::{Either, Left, Right}; -use kinds::Owned; use libc; use option; use option::unwrap; use pipes; use ptr; -use prelude::*; use private; use task; use vec; @@ -1240,8 +1238,6 @@ pub fn try_send_one<T: Owned>(chan: ChanOne<T>, data: T) } pub mod rt { - use option::{None, Option, Some}; - // These are used to hide the option constructors from the // compiler because their names are changing pub fn make_some<T>(val: T) -> Option<T> { Some(move val) } @@ -1250,8 +1246,7 @@ pub mod rt { #[cfg(test)] pub mod test { - use either::{Either, Left, Right}; - use pipes::{Chan, Port, oneshot, recv_one, stream}; + use pipes::oneshot; use pipes; #[test] diff --git a/src/libcore/prelude.rs b/src/libcore/prelude.rs deleted file mode 100644 index 3d5139a2d32..00000000000 --- a/src/libcore/prelude.rs +++ /dev/null @@ -1,93 +0,0 @@ -// This file is imported into every module by default. - -/* Reexported core operators */ - -pub use kinds::{Const, Copy, Owned, Durable}; -pub use ops::{Drop}; -pub use ops::{Add, Sub, Mul, Div, Modulo, Neg}; -pub use ops::{BitAnd, BitOr, BitXor}; -pub use ops::{Shl, Shr, Index}; -pub use option::{Option, Some, None}; -pub use result::{Result, Ok, Err}; - -/* Reexported types and traits */ - -pub use path::Path; -pub use path::GenericPath; -pub use path::WindowsPath; -pub use path::PosixPath; - -pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps}; -pub use str::{StrSlice, Trimmable}; -pub use vec::{ConstVector, CopyableVector, ImmutableVector}; -pub use vec::{ImmutableEqVector, ImmutableCopyableVector}; -pub use vec::{MutableVector, MutableCopyableVector}; -pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter}; -pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times}; - -pub use num::Num; -pub use ptr::Ptr; -pub use to_str::ToStr; -pub use clone::Clone; - -pub use cmp::{Eq, Ord}; -pub use hash::Hash; -pub use to_bytes::IterBytes; - -/* Reexported modules */ - -pub use at_vec; -pub use bool; -pub use cast; -pub use char; -pub use cmp; -pub use dvec; -pub use either; -pub use extfmt; -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 libc; -pub use num; -pub use oldcomm; -pub use ops; -pub use option; -pub use os; -pub use path; -pub use pipes; -pub use private; -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; - -/* - * Export the log levels as global constants. Higher levels mean - * more-verbosity. Error is the bottom level, default logging level is - * warn-and-below. - */ - -/// The error log level -pub const error : u32 = 1_u32; -/// The warning log level -pub const warn : u32 = 2_u32; -/// The info log level -pub const info : u32 = 3_u32; -/// The debug log level -pub const debug : u32 = 4_u32; diff --git a/src/libcore/private.rs b/src/libcore/private.rs index 273e933f530..efa5062ad98 100644 --- a/src/libcore/private.rs +++ b/src/libcore/private.rs @@ -21,7 +21,6 @@ use libc; use oldcomm; use option; use pipes; -use prelude::*; use ptr; use result; use task; @@ -581,11 +580,8 @@ pub fn unwrap_exclusive<T: Owned>(arc: Exclusive<T>) -> T { #[cfg(test)] pub mod tests { - use core::option::{None, Some}; - use option; use pipes; - use private::{exclusive, unwrap_exclusive}; use result; use task; use uint; diff --git a/src/libcore/rand.rs b/src/libcore/rand.rs index cf114f0b5bc..d816f23d4c0 100644 --- a/src/libcore/rand.rs +++ b/src/libcore/rand.rs @@ -15,7 +15,6 @@ #[forbid(deprecated_pattern)]; use int; -use prelude::*; use str; use task; use u32; @@ -363,8 +362,7 @@ pub fn random() -> uint { #[cfg(test)] pub mod tests { - use debug; - use option::{None, Option, Some}; + use option::Option; use rand; #[test] diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 91f51908be8..9e9886e66ab 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -19,8 +19,6 @@ use cmp; use cmp::Eq; use either; use either::Either; -use kinds::Copy; -use option::{None, Option, Some}; use vec; /// The result type @@ -384,7 +382,6 @@ pub pure fn unwrap_err<T, U>(res: Result<T, U>) -> U { mod tests { #[legacy_exports]; - use result::{Err, Ok, Result, chain, get, get_err}; use result; fn op1() -> result::Result<int, ~str> { result::Ok(666) } diff --git a/src/libcore/run.rs b/src/libcore/run.rs index 60fe54109d0..b753c647627 100644 --- a/src/libcore/run.rs +++ b/src/libcore/run.rs @@ -20,7 +20,6 @@ use libc::{pid_t, c_void, c_int}; use oldcomm; use option::{Some, None}; use os; -use prelude::*; use ptr; use run; use str; @@ -350,7 +349,7 @@ pub fn program_output(prog: &str, args: &[~str]) -> return {status: status, out: move outs, err: move errs}; } -pub fn writeclose(fd: c_int, s: ~str) { +fn writeclose(fd: c_int, s: ~str) { use io::WriterUtil; error!("writeclose %d, %s", fd as int, s); @@ -360,7 +359,7 @@ pub fn writeclose(fd: c_int, s: ~str) { os::close(fd); } -pub fn readclose(fd: c_int) -> ~str { +fn readclose(fd: c_int) -> ~str { let file = os::fdopen(fd); let reader = io::FILE_reader(file, false); let buf = io::with_bytes_writer(|writer| { @@ -418,11 +417,8 @@ pub fn waitpid(pid: pid_t) -> int { #[cfg(test)] mod tests { - use debug; use io::WriterUtil; - use option::{None, Some}; use os; - use run::{readclose, writeclose}; use run; // Regression test for memory leaks diff --git a/src/libcore/send_map.rs b/src/libcore/send_map.rs index 4cd3502bd62..b6f237e14fb 100644 --- a/src/libcore/send_map.rs +++ b/src/libcore/send_map.rs @@ -20,7 +20,6 @@ Sendable hash maps. Very much a work in progress. use cmp::Eq; use hash::Hash; -use prelude::*; use to_bytes::IterBytes; pub trait SendMap<K:Eq Hash, V: Copy> { @@ -46,14 +45,9 @@ pub trait SendMap<K:Eq Hash, V: Copy> { /// Open addressing with linear probing. pub mod linear { - use cmp::Eq; use cmp; - use hash::Hash; - use kinds::Copy; - use option::{None, Option, Some}; use option; use rand; - use to_bytes::IterBytes; use uint; use vec; @@ -464,7 +458,6 @@ pub mod linear { #[test] pub mod test { - use option::{None, Some}; use send_map::linear::LinearMap; use send_map::linear; use uint; diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 722d62626a6..a1595e4135e 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -27,7 +27,6 @@ use cmp::{Eq, Ord}; use libc; use libc::size_t; use io::WriterUtil; -use option::{None, Option, Some}; use ptr; use str; use to_str::ToStr; @@ -1950,7 +1949,6 @@ pub mod raw { use libc; use ptr; use str::raw; - use str::{as_buf, is_utf8, len, reserve_at_least}; use vec; /// Create a Rust string from a null-terminated *u8 buffer @@ -2131,9 +2129,6 @@ impl ~str: Trimmable { #[cfg(notest)] pub mod traits { - use ops::Add; - use str::append; - impl ~str : Add<&str,~str> { #[inline(always)] pure fn add(&self, rhs: & &self/str) -> ~str { @@ -2313,11 +2308,10 @@ impl &str: StrSlice { #[cfg(test)] mod tests { use char; - use debug; use libc::c_char; use libc; use ptr; - use str::*; + use str::raw; use vec; #[test] diff --git a/src/libcore/sys.rs b/src/libcore/sys.rs index 4cefe2fea1c..d79fa3a86ff 100644 --- a/src/libcore/sys.rs +++ b/src/libcore/sys.rs @@ -146,7 +146,6 @@ pub pure fn begin_unwind_(msg: *c_char, file: *c_char, line: size_t) -> ! { #[cfg(test)] pub mod tests { use cast; - use sys::{Closure, pref_align_of, size_of}; #[test] pub fn size_of_basic() { diff --git a/src/libcore/task/local_data.rs b/src/libcore/task/local_data.rs index 990d309a159..0cfceb6358a 100644 --- a/src/libcore/task/local_data.rs +++ b/src/libcore/task/local_data.rs @@ -26,7 +26,6 @@ magic. */ -use prelude::*; use rt; use task::local_data_priv::{local_get, local_pop, local_modify, local_set}; use task; diff --git a/src/libcore/task/local_data_priv.rs b/src/libcore/task/local_data_priv.rs index c08f0f9c997..c6b3cfa6626 100644 --- a/src/libcore/task/local_data_priv.rs +++ b/src/libcore/task/local_data_priv.rs @@ -11,11 +11,9 @@ #[doc(hidden)]; // FIXME #3538 use cast; -use cmp::Eq; use dvec; use libc; use option; -use prelude::*; use task::rt; use task::local_data::LocalDataKey; diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs index 62d30bdc45c..245b955c871 100644 --- a/src/libcore/task/mod.rs +++ b/src/libcore/task/mod.rs @@ -48,7 +48,6 @@ use option; use result::Result; use pipes::{stream, Chan, Port}; use pipes; -use prelude::*; use ptr; use result; use task::local_data_priv::{local_get, local_set}; diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs index 1ffd7fee6b1..a904cbec3e5 100644 --- a/src/libcore/task/spawn.rs +++ b/src/libcore/task/spawn.rs @@ -76,19 +76,13 @@ use cast; use oldcomm; use option; -use pipes::{Chan, Port}; use pipes; -use prelude::*; use private; use ptr; use send_map; -use task::local_data_priv::{local_get, local_set}; +use task::rt; use task::rt::rust_task; use task::rt::rust_closure; -use task::rt; -use task::{Failure, ManualThreads, PlatformThread, SchedOpts, SingleThreaded}; -use task::{Success, TaskOpts, TaskResult, ThreadPerCore, ThreadPerTask}; -use task::{default_task_opts, unkillable}; use uint; use util; diff --git a/src/libcore/to_bytes.rs b/src/libcore/to_bytes.rs index 8f5ca4bc72a..edd69219c3f 100644 --- a/src/libcore/to_bytes.rs +++ b/src/libcore/to_bytes.rs @@ -20,7 +20,6 @@ The `ToBytes` and `IterBytes` traits use io; use io::Writer; -use option::{None, Option, Some}; use str; pub type Cb = fn(buf: &[const u8]) -> bool; @@ -182,8 +181,6 @@ pub mod x32 { #[cfg(target_word_size = "64")] pub mod x64 { - use to_bytes::{Cb, IterBytes}; - pub impl uint: IterBytes { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { diff --git a/src/libcore/to_str.rs b/src/libcore/to_str.rs index fb4ea48ca95..963901c2c75 100644 --- a/src/libcore/to_str.rs +++ b/src/libcore/to_str.rs @@ -18,7 +18,6 @@ The `ToStr` trait for converting to strings #[forbid(deprecated_mode)]; #[forbid(deprecated_pattern)]; -use kinds::Copy; use str; use vec; diff --git a/src/libcore/tuple.rs b/src/libcore/tuple.rs index 6ac7a1a04a3..c602c193170 100644 --- a/src/libcore/tuple.rs +++ b/src/libcore/tuple.rs @@ -15,7 +15,6 @@ //! Operations on tuples use cmp::{Eq, Ord}; -use kinds::Copy; use vec; pub trait CopyableTuple<T, U> { diff --git a/src/libcore/uint-template.rs b/src/libcore/uint-template.rs index ad6f73e56c0..ec280568282 100644 --- a/src/libcore/uint-template.rs +++ b/src/libcore/uint-template.rs @@ -19,7 +19,6 @@ use cmp::{Eq, Ord}; use from_str::FromStr; use iter; use num; -use option::{None, Option, Some}; use str; use uint; use vec; diff --git a/src/libcore/util.rs b/src/libcore/util.rs index 423dbaedf26..7dbc9f76f7a 100644 --- a/src/libcore/util.rs +++ b/src/libcore/util.rs @@ -19,7 +19,6 @@ Miscellaneous helpers for common patterns. #[forbid(deprecated_pattern)]; use cmp::Eq; -use prelude::*; /// The identity function. #[inline(always)] @@ -105,10 +104,6 @@ pub fn unreachable() -> ! { mod tests { #[legacy_exports]; - - use option::{None, Some}; - use util::{NonCopyable, id, replace, swap}; - #[test] fn identity_crisis() { // Writing a test for the identity function. How did it come to this? diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 541dcde2181..a128b45c350 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -16,12 +16,10 @@ use cast; use cmp::{Eq, Ord}; -use iter::BaseIter; use iter; -use kinds::Copy; use libc; use libc::size_t; -use option::{None, Option, Some}; +use option::{Some, None}; use ptr; use ptr::addr_of; use sys; @@ -675,7 +673,7 @@ pub pure fn append_one<T>(lhs: ~[T], x: T) -> ~[T] { } #[inline(always)] -pub pure fn append_mut<T: Copy>(lhs: ~[mut T], rhs: &[const T]) -> ~[mut T] { +pure fn append_mut<T: Copy>(lhs: ~[mut T], rhs: &[const T]) -> ~[mut T] { to_mut(append(from_mut(lhs), rhs)) } @@ -1519,10 +1517,6 @@ impl<T: Ord> @[T] : Ord { #[cfg(notest)] pub mod traits { - use kinds::Copy; - use ops::Add; - use vec::{append, append_mut}; - impl<T: Copy> ~[T] : Add<&[const T],~[T]> { #[inline(always)] pure fn add(&self, rhs: & &self/[const T]) -> ~[T] { @@ -1845,14 +1839,10 @@ pub struct UnboxedVecRepr { /// Unsafe operations pub mod raw { - use kinds::Copy; use managed; - use option::{None, Some}; use option; - use ptr::addr_of; use ptr; use sys; - use vec::{UnboxedVecRepr, as_const_buf, as_mut_buf, len, with_capacity}; use vec::rusti; /// The internal representation of a (boxed) vector @@ -2002,9 +1992,8 @@ pub mod raw { pub mod bytes { use libc; use uint; - use vec::len; - use vec::raw; use vec; + use vec::raw; /// Bytewise string comparison pub pure fn cmp(a: &~[u8], b: &~[u8]) -> int { @@ -2291,9 +2280,8 @@ impl<A:Copy> @[A] : iter::CopyableNonstrictIter<A> { #[cfg(test)] mod tests { - use option::{None, Option, Some}; use option; - use vec::*; + use vec::raw; fn square(n: uint) -> uint { return n * n; } diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 85268ad8f02..59d9886455a 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use back::rpath; use driver::session; @@ -30,7 +29,6 @@ use core::cmp; use core::hash; use core::io::{Writer, WriterUtil}; use core::libc::{c_int, c_uint, c_char}; -use core::os::consts::{macos, freebsd, linux, win32}; use core::os; use core::ptr; use core::run; @@ -43,7 +41,9 @@ use syntax::ast_map::{path, path_mod, path_name}; use syntax::attr; use syntax::print::pprust; -pub enum output_type { +use core::os::consts::{macos, freebsd, linux, win32}; + +enum output_type { output_type_none, output_type_bitcode, output_type_assembly, @@ -59,7 +59,7 @@ impl output_type : cmp::Eq { pure fn ne(&self, other: &output_type) -> bool { !(*self).eq(other) } } -pub fn llvm_err(sess: Session, +msg: ~str) -> ! unsafe { +fn llvm_err(sess: Session, +msg: ~str) -> ! unsafe { let cstr = llvm::LLVMRustGetLastError(); if cstr == ptr::null() { sess.fatal(msg); @@ -68,7 +68,7 @@ pub fn llvm_err(sess: Session, +msg: ~str) -> ! unsafe { } } -pub fn WriteOutputFile(sess: Session, +fn WriteOutputFile(sess: Session, PM: lib::llvm::PassManagerRef, M: ModuleRef, Triple: *c_char, // FIXME: When #2334 is fixed, change @@ -86,14 +86,10 @@ pub fn WriteOutputFile(sess: Session, pub mod jit { #[legacy_exports]; - use back::link::llvm_err; use lib::llvm::llvm; - use lib::llvm::{ModuleRef, PassManagerRef, mk_target_data}; use metadata::cstore; - use session::Session; use core::cast; - use core::libc::c_int; use core::ptr; use core::str; @@ -165,19 +161,11 @@ mod write { #[legacy_exports]; use back::link::jit; - use back::link::{ModuleRef, WriteOutputFile, output_type}; - use back::link::{output_type_assembly, output_type_bitcode}; - use back::link::{output_type_exe, output_type_llvm_assembly}; - use back::link::{output_type_object}; use driver::session; use lib::llvm::llvm; - use lib::llvm::{False, True, mk_pass_manager, mk_target_data}; use lib; - use session::Session; use core::char; - use core::libc::{c_char, c_int, c_uint}; - use core::path::Path; use core::str; use core::vec; diff --git a/src/librustc/back/rpath.rs b/src/librustc/back/rpath.rs index 8378270bee4..c6b43ff6ad5 100644 --- a/src/librustc/back/rpath.rs +++ b/src/librustc/back/rpath.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use driver::session; use metadata::cstore; @@ -21,13 +20,7 @@ use core::vec; use std::map::HashMap; use std::map; -export get_absolute_rpath; -export get_install_prefix_rpath; -export get_relative_to; export get_rpath_flags; -export get_rpath_relative_to_output; -export minimize_rpaths; -export rpaths_to_flags; pure fn not_win32(os: session::os) -> bool { match os { @@ -209,11 +202,6 @@ fn minimize_rpaths(rpaths: &[Path]) -> ~[Path] { mod test { #[legacy_exports]; - use core::prelude::*; - - 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}; use driver::session; use core::os; diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs index cbc598228a4..3212adf29ac 100644 --- a/src/librustc/driver/driver.rs +++ b/src/librustc/driver/driver.rs @@ -9,7 +9,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use back::link; use back::{x86, x86_64}; @@ -831,13 +830,7 @@ fn list_metadata(sess: Session, path: &Path, out: io::Writer) { mod test { #[legacy_exports]; - use core::prelude::*; - - use driver::driver::{build_configuration, build_session}; - use driver::driver::{build_session_options, optgroups, str_input}; - use core::vec; - use std::getopts::groups::getopts; use std::getopts; use syntax::attr; use syntax::diagnostic; diff --git a/src/librustc/driver/session.rs b/src/librustc/driver/session.rs index ee34570203b..d60ad7606fd 100644 --- a/src/librustc/driver/session.rs +++ b/src/librustc/driver/session.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use back::link; use back::target_strs; @@ -334,12 +333,6 @@ fn sess_os_to_meta_os(os: os) -> metadata::loader::os { #[cfg(test)] mod test { #[legacy_exports]; - - use core::prelude::*; - - use driver::session::{bin_crate, building_library, lib_crate}; - use driver::session::{unknown_crate}; - use syntax::ast; use syntax::ast_util; diff --git a/src/librustc/front/config.rs b/src/librustc/front/config.rs index b5622e1e575..7a073057f0d 100644 --- a/src/librustc/front/config.rs +++ b/src/librustc/front/config.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use syntax::{ast, fold, attr}; diff --git a/src/librustc/front/core_inject.rs b/src/librustc/front/core_inject.rs index 9bd7566e2e7..6df5e367ad1 100644 --- a/src/librustc/front/core_inject.rs +++ b/src/librustc/front/core_inject.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use driver::session::Session; @@ -76,18 +75,10 @@ fn inject_libcore_ref(sess: Session, fold_mod: |module, fld| { let n2 = sess.next_node_id(); - let prelude_path = @{ - span: dummy_sp(), - global: false, - idents: ~[ - sess.ident_of(~"core"), - sess.ident_of(~"prelude") - ], - rp: None, - types: ~[] - }; - - let vp = @spanned(ast::view_path_glob(prelude_path, n2)); + let vp = @spanned( + ast::view_path_glob(ident_to_path(dummy_sp(), + sess.ident_of(~"core")), + n2)); let vi2 = @{node: ast::view_item_import(~[vp]), attrs: ~[], vis: ast::private, diff --git a/src/librustc/front/intrinsic_inject.rs b/src/librustc/front/intrinsic_inject.rs index bad8ca88ad8..08b61557fdd 100644 --- a/src/librustc/front/intrinsic_inject.rs +++ b/src/librustc/front/intrinsic_inject.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use driver::session::Session; use syntax::parse; diff --git a/src/librustc/front/test.rs b/src/librustc/front/test.rs index 1e2063649b0..09db770512f 100644 --- a/src/librustc/front/test.rs +++ b/src/librustc/front/test.rs @@ -10,7 +10,6 @@ // Code that generates a test runner to run all the tests in a crate -use core::prelude::*; use driver::session; use front::config; diff --git a/src/librustc/lib/llvm.rs b/src/librustc/lib/llvm.rs index d5c05584539..62956341189 100644 --- a/src/librustc/lib/llvm.rs +++ b/src/librustc/lib/llvm.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use core::cast; use core::cmp; diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 078b5ea9a4b..da33aaa460b 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -11,8 +11,6 @@ //! Validates all used crates and extern libraries and loads their metadata -use core::prelude::*; - use metadata::cstore; use metadata::common::*; use metadata::decoder; diff --git a/src/librustc/metadata/csearch.rs b/src/librustc/metadata/csearch.rs index 2b1c66eb4bb..2dfe5bad27a 100644 --- a/src/librustc/metadata/csearch.rs +++ b/src/librustc/metadata/csearch.rs @@ -11,8 +11,6 @@ // Searching for information from the cstore -use core::prelude::*; - use metadata::common::*; use metadata::cstore; use metadata::decoder; diff --git a/src/librustc/metadata/cstore.rs b/src/librustc/metadata/cstore.rs index e9d6711d87b..b09f2d87b6c 100644 --- a/src/librustc/metadata/cstore.rs +++ b/src/librustc/metadata/cstore.rs @@ -12,8 +12,6 @@ // The crate store - a central repo for information collected about external // crates and libraries -use core::prelude::*; - use metadata::creader; use metadata::cstore; use metadata::decoder; diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs index dbc70f1318c..d4cebea66cd 100644 --- a/src/librustc/metadata/decoder.rs +++ b/src/librustc/metadata/decoder.rs @@ -11,8 +11,6 @@ // Decoding metadata from a single crate's metadata -use core::prelude::*; - use cmd = metadata::cstore::crate_metadata; use dvec::DVec; use hash::{Hash, HashUtil}; diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index f52c2e448fe..5a936e113ee 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -11,8 +11,6 @@ // Metadata encoding -use core::prelude::*; - use metadata::common::*; use metadata::csearch; use metadata::cstore; diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index 15c0a1944ea..0401d8fcb6c 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -13,8 +13,6 @@ // FIXME (#2658): I'm not happy how this module turned out. Should // probably just be folded into cstore. -use core::prelude::*; - use core::option; use core::os; use core::result::Result; diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs index 535f45ae839..fa858f9e9a3 100644 --- a/src/librustc/metadata/loader.rs +++ b/src/librustc/metadata/loader.rs @@ -11,8 +11,6 @@ //! Finds crate binaries and loads their metadata -use core::prelude::*; - use lib::llvm::{False, llvm, mk_object_file, mk_section_iter}; use metadata::decoder; use metadata::encoder; @@ -28,13 +26,14 @@ use core::cast; use core::flate; use core::io::WriterUtil; use core::io; -use core::os::consts::{macos, freebsd, linux, win32}; use core::option; use core::ptr; use core::str; use core::uint; use core::vec; +use core::os::consts::{macos, freebsd, linux, win32}; + export os; export os_macos, os_win32, os_linux, os_freebsd; export ctxt; diff --git a/src/librustc/metadata/tydecode.rs b/src/librustc/metadata/tydecode.rs index 927ef29b04f..089e528c0c2 100644 --- a/src/librustc/metadata/tydecode.rs +++ b/src/librustc/metadata/tydecode.rs @@ -14,8 +14,6 @@ // tjc note: Would be great to have a `match check` macro equivalent // for some of these -use core::prelude::*; - use middle::ty; use middle::ty::{FnTyBase, FnMeta, FnSig}; diff --git a/src/librustc/metadata/tyencode.rs b/src/librustc/metadata/tyencode.rs index 67f168cc5b6..24095ebfe00 100644 --- a/src/librustc/metadata/tyencode.rs +++ b/src/librustc/metadata/tyencode.rs @@ -11,8 +11,6 @@ // Type encoding -use core::prelude::*; - use middle::ty; use middle::ty::vid; diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index c2f2d7711af..c97553ce1c0 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use c = metadata::common; use cstore = metadata::cstore; diff --git a/src/librustc/middle/borrowck/check_loans.rs b/src/librustc/middle/borrowck/check_loans.rs index 534098d96dc..4370707e665 100644 --- a/src/librustc/middle/borrowck/check_loans.rs +++ b/src/librustc/middle/borrowck/check_loans.rs @@ -15,29 +15,18 @@ // 1. assignments are always made to mutable locations; // 2. loans made in overlapping scopes do not conflict // 3. assignments do not affect things loaned out as immutable -// 4. moves do not affect things loaned out in any way +// 4. moves to dnot affect things loaned out in any way -use core::prelude::*; -use middle::borrowck::{Loan, bckerr, borrowck_ctxt, cmt, inherent_mutability}; -use middle::borrowck::{req_maps, save_and_restore}; -use middle::mem_categorization::{cat_arg, cat_binding, cat_deref, cat_local}; -use middle::mem_categorization::{cat_rvalue, cat_special}; -use middle::mem_categorization::{loan_path, lp_arg, lp_comp, lp_deref}; -use middle::mem_categorization::{lp_local}; use middle::ty::{CopyValue, MoveValue, ReadValue}; use middle::ty; -use util::ppaux::ty_to_str; use core::cmp; use core::dvec::DVec; use core::uint; use core::vec; -use std::map::HashMap; -use syntax::ast::{m_const, m_imm, m_mutbl}; use syntax::ast; use syntax::ast_util; -use syntax::codemap::span; use syntax::print::pprust; use syntax::visit; diff --git a/src/librustc/middle/borrowck/gather_loans.rs b/src/librustc/middle/borrowck/gather_loans.rs index 215256a8e95..d5652ae78d6 100644 --- a/src/librustc/middle/borrowck/gather_loans.rs +++ b/src/librustc/middle/borrowck/gather_loans.rs @@ -16,26 +16,17 @@ // their associated scopes. In phase two, checking loans, we will then make // sure that all of these loans are honored. -use core::prelude::*; use middle::borrowck::preserve::{preserve_condition, pc_ok, pc_if_pure}; -use middle::borrowck::{Loan, bckres, borrowck_ctxt, err_mutbl, req_maps}; -use middle::mem_categorization::{cat_binding, cat_discr, cmt, comp_variant}; -use middle::mem_categorization::{mem_categorization_ctxt}; -use middle::mem_categorization::{opt_deref_kind}; +use middle::mem_categorization::{mem_categorization_ctxt, opt_deref_kind}; use middle::pat_util; use middle::ty::{ty_region}; use middle::ty; -use util::common::indenter; -use util::ppaux::{expr_repr, region_to_str}; use core::dvec; use core::send_map::linear::LinearMap; use core::vec; -use std::map::HashMap; -use syntax::ast::{m_const, m_imm, m_mutbl}; use syntax::ast; -use syntax::codemap::span; use syntax::print::pprust; use syntax::visit; diff --git a/src/librustc/middle/borrowck/loan.rs b/src/librustc/middle/borrowck/loan.rs index 92a3ce24589..6539cb0c6c3 100644 --- a/src/librustc/middle/borrowck/loan.rs +++ b/src/librustc/middle/borrowck/loan.rs @@ -12,19 +12,10 @@ // Loan(Ex, M, S) = Ls holds if ToAddr(Ex) will remain valid for the entirety // of the scope S, presuming that the returned set of loans `Ls` are honored. -use core::prelude::*; -use middle::borrowck::{Loan, bckres, borrowck_ctxt, cmt, err_mutbl}; -use middle::borrowck::{err_out_of_scope}; -use middle::mem_categorization::{cat_arg, cat_binding, cat_discr, cat_comp}; -use middle::mem_categorization::{cat_deref, cat_discr, cat_local}; -use middle::mem_categorization::{cat_special, cat_stack_upvar, comp_field}; -use middle::mem_categorization::{comp_index, comp_variant, region_ptr}; use middle::ty; -use util::common::indenter; -use core::result::{Err, Ok, Result}; -use syntax::ast::{m_const, m_imm, m_mutbl}; +use core::result::{Result, Ok, Err}; use syntax::ast; export public_methods; diff --git a/src/librustc/middle/borrowck/mod.rs b/src/librustc/middle/borrowck/mod.rs index a6fbe5bd6dd..fa7dfd1b77f 100644 --- a/src/librustc/middle/borrowck/mod.rs +++ b/src/librustc/middle/borrowck/mod.rs @@ -226,8 +226,6 @@ Borrowck results in two maps. #[legacy_exports]; -use core::prelude::*; - use middle::liveness; use middle::mem_categorization::*; use middle::region; @@ -261,6 +259,9 @@ pub mod loan; #[legacy_exports] pub mod preserve; +export check_crate, root_map, mutbl_map; +export check_loans, gather_loans, loan, preserve; + fn check_crate(tcx: ty::ctxt, method_map: typeck::method_map, last_use_map: liveness::last_use_map, @@ -409,7 +410,7 @@ impl bckerr : cmp::Eq { type bckres<T> = Result<T, bckerr>; /// a complete record of a loan that was granted -pub struct Loan {lp: @loan_path, cmt: cmt, mutbl: ast::mutability} +struct Loan {lp: @loan_path, cmt: cmt, mutbl: ast::mutability} /// maps computed by `gather_loans` that are then used by `check_loans` /// @@ -417,7 +418,7 @@ pub struct Loan {lp: @loan_path, cmt: cmt, mutbl: ast::mutability} /// for the duration of that block/expr /// - `pure_map`: map from block/expr that must be pure to the error message /// that should be reported if they are not pure -pub type req_maps = { +type req_maps = { req_loan_map: HashMap<ast::node_id, @DVec<Loan>>, pure_map: HashMap<ast::node_id, bckerr> }; diff --git a/src/librustc/middle/borrowck/preserve.rs b/src/librustc/middle/borrowck/preserve.rs index 600ede8c720..e6d311fd04f 100644 --- a/src/librustc/middle/borrowck/preserve.rs +++ b/src/librustc/middle/borrowck/preserve.rs @@ -13,19 +13,9 @@ // the scope S. // -use core::prelude::*; -use middle::borrowck::{bckerr, bckerr_code, bckres, borrowck_ctxt, cmt}; -use middle::borrowck::{err_mut_uniq, err_mut_variant, err_out_of_root_scope}; -use middle::borrowck::{err_out_of_scope, err_root_not_permitted}; -use middle::mem_categorization::{cat_arg, cat_binding, cat_comp, cat_deref}; -use middle::mem_categorization::{cat_discr, cat_local, cat_special}; -use middle::mem_categorization::{cat_stack_upvar, comp_field, comp_index}; -use middle::mem_categorization::{comp_variant, region_ptr}; use middle::ty; -use util::common::indenter; -use syntax::ast::{m_const, m_imm, m_mutbl}; use syntax::ast; export public_methods, preserve_condition, pc_ok, pc_if_pure; diff --git a/src/librustc/middle/capture.rs b/src/librustc/middle/capture.rs index bd8d1b64906..86d9151ae9b 100644 --- a/src/librustc/middle/capture.rs +++ b/src/librustc/middle/capture.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::freevars; use middle::ty; diff --git a/src/librustc/middle/check_const.rs b/src/librustc/middle/check_const.rs index b8d222aecd7..13df0b73db0 100644 --- a/src/librustc/middle/check_const.rs +++ b/src/librustc/middle/check_const.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use driver::session::Session; use middle::resolve; diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index c70d17423cf..dc66df93624 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::const_eval::{compare_const_vals, lookup_const_by_id}; use middle::const_eval::{eval_const_expr, const_val, const_int, const_bool}; diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index 5821bf4fbe5..e2de186ca2f 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::resolve; use middle::ty; diff --git a/src/librustc/middle/kind.rs b/src/librustc/middle/kind.rs index f2a7dd0648c..671a0a2dc81 100644 --- a/src/librustc/middle/kind.rs +++ b/src/librustc/middle/kind.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::freevars::freevar_entry; use middle::freevars; diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs index cca71153a7d..8c887139b70 100644 --- a/src/librustc/middle/lang_items.rs +++ b/src/librustc/middle/lang_items.rs @@ -20,8 +20,6 @@ // // * Functions called by the compiler itself. -use core::prelude::*; - use driver::session::Session; use metadata::csearch::{each_lang_item, get_item_attrs}; use metadata::cstore::{iter_crate_data}; diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index d5992d201bb..635e2d18d6c 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use driver::session::Session; use driver::session; diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 6c78c270139..91e6ed289bd 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -103,8 +103,6 @@ * to return explicitly. */ -use core::prelude::*; - use middle::capture::{cap_move, cap_drop, cap_copy, cap_ref}; use middle::capture; use middle::pat_util; diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index b72950cbf4b..9b373ef0c16 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -47,8 +47,6 @@ * then an index to jump forward to the relevant item. */ -use core::prelude::*; - use middle::ty; use middle::typeck; use util::ppaux::{ty_to_str, region_to_str}; @@ -138,7 +136,7 @@ impl categorization : cmp::Eq { } // different kinds of pointers: -pub enum ptr_kind { +enum ptr_kind { uniq_ptr, gc_ptr, region_ptr(ty::Region), @@ -179,7 +177,7 @@ impl ptr_kind : cmp::Eq { // I am coining the term "components" to mean "pieces of a data // structure accessible without a dereference": -pub enum comp_kind { +enum comp_kind { comp_tuple, // elt in a tuple comp_anon_field, // anonymous field (in e.g. // struct Foo(int, int); @@ -271,7 +269,7 @@ impl cmt_ : cmp::Eq { // a loan path is like a category, but it exists only when the data is // interior to the stack frame. loan paths are used as the key to a // map indicating what is borrowed at any point in time. -pub enum loan_path { +enum loan_path { lp_local(ast::node_id), lp_arg(ast::node_id), lp_deref(@loan_path, ptr_kind), diff --git a/src/librustc/middle/mode.rs b/src/librustc/middle/mode.rs index 00be40cbf49..a736b3d2fa6 100644 --- a/src/librustc/middle/mode.rs +++ b/src/librustc/middle/mode.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::pat_util; use middle::ty; diff --git a/src/librustc/middle/pat_util.rs b/src/librustc/middle/pat_util.rs index 5a4d36f1d10..54d3180dbe4 100644 --- a/src/librustc/middle/pat_util.rs +++ b/src/librustc/middle/pat_util.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::resolve; use middle::ty::{CopyValue, MoveValue, ReadValue}; diff --git a/src/librustc/middle/privacy.rs b/src/librustc/middle/privacy.rs index 56dee0843dd..1aa3017083c 100644 --- a/src/librustc/middle/privacy.rs +++ b/src/librustc/middle/privacy.rs @@ -12,8 +12,6 @@ // A pass that checks to make sure private fields and methods aren't used // outside their scopes. -use core::prelude::*; - use middle::ty::{ty_struct, ty_enum}; use middle::ty; use middle::typeck::{method_map, method_origin, method_param, method_self}; diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index 21ccfd3b5f2..6f9c3070a0e 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -17,7 +17,6 @@ region parameterized. */ -use core::prelude::*; use driver::session::Session; use metadata::csearch; diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index 4e5e9b97957..625ed9076e7 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use driver::session::Session; use metadata::csearch::{each_path, get_method_names_if_trait}; @@ -3076,6 +3075,77 @@ impl Resolver { self.module_to_str(containing_module)); return Success(PrefixFound(containing_module, i)); + + /* + // If we reached the end, return the containing module. + if i == module_path.len() { + return ModulePrefixResult { + result: Success(containing_module), + prefix_len: i + }; + } + + // Is the containing module the current module? If so, we allow + // globs to be unresolved. + let allow_globs = core::managed::ptr_eq(containing_module, module_); + + let name = module_path.get_elt(i); + i += 1; + + let resolve_result = self.resolve_name_in_module(containing_module, + name, + TypeNS, + Xray, + allow_globs); + match resolve_result { + Success(target) => { + match target.bindings.type_def { + Some(ref type_def) => { + match (*type_def).module_def { + None => { + error!("!!! (resolving crate-relative \ + module) module wasn't actually a \ + module!"); + return ModulePrefixResult { + result: Failed, + prefix_len: i + }; + } + Some(module_def) => { + return ModulePrefixResult { + result: Success(module_def), + prefix_len: i + }; + } + } + } + None => { + error!("!!! (resolving crate-relative module) module + wasn't actually a module!"); + return ModulePrefixResult { + result: Failed, + prefix_len: i + }; + } + } + } + Indeterminate => { + debug!("(resolving crate-relative module) indeterminate; \ + bailing"); + return ModulePrefixResult { + result: Indeterminate, + prefix_len: i + }; + } + Failed => { + debug!("(resolving crate-relative module) failed to resolve"); + return ModulePrefixResult { + result: Failed, + prefix_len: i + }; + } + } + */ } fn name_is_exported(module_: @Module, name: ident) -> bool { @@ -3095,6 +3165,7 @@ impl Resolver { xray: XrayFlag, allow_globs: bool) -> ResolveResult<Target> { + debug!("(resolving name in module) resolving `%s` in `%s`", self.session.str_of(name), self.module_to_str(module_)); @@ -4747,7 +4818,7 @@ impl Resolver { } return self.resolve_item_by_identifier_in_lexical_scope(identifier, - namespace); + namespace); } // XXX: Merge me with resolve_name_in_module? @@ -4964,7 +5035,7 @@ impl Resolver { match self.resolve_item_in_lexical_scope(self.current_module, ident, namespace, - DontSearchThroughModules) { + SearchThroughModules) { Success(target) => { match (*target.bindings).def_for_namespace(namespace) { None => { diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs index 2b07ed1fc2d..97331021560 100644 --- a/src/librustc/middle/trans/_match.rs +++ b/src/librustc/middle/trans/_match.rs @@ -142,7 +142,6 @@ * */ -use core::prelude::*; use back::abi; use lib::llvm::llvm; diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index 78c70dd3cf1..317d0fbfd03 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -23,7 +23,6 @@ // but many TypeRefs correspond to one ty::t; for instance, tup(int, int, // int) and rec(x=int, y=int, z=int) will have the same TypeRef. -use core::prelude::*; use back::link::{mangle_exported_name}; use back::link::{mangle_internal_name_by_path_and_seq}; diff --git a/src/librustc/middle/trans/callee.rs b/src/librustc/middle/trans/callee.rs index 8f02cee5b2a..88f908c4c26 100644 --- a/src/librustc/middle/trans/callee.rs +++ b/src/librustc/middle/trans/callee.rs @@ -16,7 +16,6 @@ // and methods are represented as just a fn ptr and not a full // closure. -use core::prelude::*; use lib::llvm::ValueRef; use middle::trans::base::{get_item_val, trans_external_path}; diff --git a/src/librustc/middle/trans/closure.rs b/src/librustc/middle/trans/closure.rs index 63287055685..6a0c2aceda3 100644 --- a/src/librustc/middle/trans/closure.rs +++ b/src/librustc/middle/trans/closure.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use back::abi; use back::link::{mangle_internal_name_by_path_and_seq}; diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs index 3bec973fc90..ee2028200e4 100644 --- a/src/librustc/middle/trans/common.rs +++ b/src/librustc/middle/trans/common.rs @@ -14,8 +14,6 @@ */ -use core::prelude::*; - use back::{link, abi, upcall}; use driver::session; use driver::session::Session; diff --git a/src/librustc/middle/trans/consts.rs b/src/librustc/middle/trans/consts.rs index 0f57ca09386..0d698b2871d 100644 --- a/src/librustc/middle/trans/consts.rs +++ b/src/librustc/middle/trans/consts.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::const_eval; use middle::trans::base::get_insn_ctxt; diff --git a/src/librustc/middle/trans/controlflow.rs b/src/librustc/middle/trans/controlflow.rs index c1abe7e417b..7ae3fbcd1b8 100644 --- a/src/librustc/middle/trans/controlflow.rs +++ b/src/librustc/middle/trans/controlflow.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use lib::llvm::ValueRef; use middle::trans::base::*; diff --git a/src/librustc/middle/trans/datum.rs b/src/librustc/middle/trans/datum.rs index b94d0658597..5c13364ddeb 100644 --- a/src/librustc/middle/trans/datum.rs +++ b/src/librustc/middle/trans/datum.rs @@ -95,7 +95,6 @@ * methods themselves. Most are only suitable for some types of * values. */ -use core::prelude::*; use lib::llvm::ValueRef; use middle::trans::base::*; diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index ce8db8690ac..10edfb2f929 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use driver::session; use lib::llvm::ValueRef; diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs index 40face3655d..ed9abea465b 100644 --- a/src/librustc/middle/trans/expr.rs +++ b/src/librustc/middle/trans/expr.rs @@ -111,7 +111,6 @@ lvalues are *never* stored by value. */ -use core::prelude::*; use lib::llvm::ValueRef; use middle::resolve; diff --git a/src/librustc/middle/trans/foreign.rs b/src/librustc/middle/trans/foreign.rs index 658cffa936b..85aed8d5387 100644 --- a/src/librustc/middle/trans/foreign.rs +++ b/src/librustc/middle/trans/foreign.rs @@ -11,7 +11,6 @@ // The classification code for the x86_64 ABI is taken from the clay language // https://github.com/jckarter/clay/blob/master/compiler/src/externals.cpp -use core::prelude::*; use back::{link, abi}; use driver::session::arch_x86_64; diff --git a/src/librustc/middle/trans/glue.rs b/src/librustc/middle/trans/glue.rs index 70049fb3e4e..2ea3873ebcd 100644 --- a/src/librustc/middle/trans/glue.rs +++ b/src/librustc/middle/trans/glue.rs @@ -12,7 +12,6 @@ // // Code relating to taking, dropping, etc as well as type descriptors. -use core::prelude::*; use lib::llvm::{ValueRef, TypeRef}; use middle::trans::base::*; diff --git a/src/librustc/middle/trans/inline.rs b/src/librustc/middle/trans/inline.rs index 447b4455adf..28955f49844 100644 --- a/src/librustc/middle/trans/inline.rs +++ b/src/librustc/middle/trans/inline.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::astencode; use middle::trans::base::{get_insn_ctxt}; diff --git a/src/librustc/middle/trans/meth.rs b/src/librustc/middle/trans/meth.rs index 9631fd8b389..070a3b667bd 100644 --- a/src/librustc/middle/trans/meth.rs +++ b/src/librustc/middle/trans/meth.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use back::{link, abi}; use driver; use lib::llvm::llvm::LLVMGetParam; diff --git a/src/librustc/middle/trans/monomorphize.rs b/src/librustc/middle/trans/monomorphize.rs index 60ad1b83807..ccbced417e2 100644 --- a/src/librustc/middle/trans/monomorphize.rs +++ b/src/librustc/middle/trans/monomorphize.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use back::link::mangle_exported_name; use middle::trans::base::{get_insn_ctxt}; diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index b894b9f50eb..2880e4b770e 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -10,8 +10,6 @@ #[warn(deprecated_pattern)]; -use core::prelude::*; - use driver::session; use metadata::csearch; use metadata; diff --git a/src/librustc/middle/typeck/astconv.rs b/src/librustc/middle/typeck/astconv.rs index 043ff3fbec4..b290f6c1742 100644 --- a/src/librustc/middle/typeck/astconv.rs +++ b/src/librustc/middle/typeck/astconv.rs @@ -52,24 +52,18 @@ * an rptr (`&r.T`) use the region `r` that appears in the rptr. */ -use core::prelude::*; -use middle::pat_util::pat_id_map; -use middle::ty::{FnTyBase, FnMeta, FnSig, ty_param_substs_and_ty}; +use middle::ty::{FnTyBase, FnMeta, FnSig}; use middle::ty; use middle::typeck::check::fn_ctxt; use middle::typeck::collect; use middle::typeck::rscope::{anon_rscope, binding_rscope, empty_rscope}; use middle::typeck::rscope::{in_anon_rscope, in_binding_rscope}; use middle::typeck::rscope::{region_scope, type_rscope}; -use middle::typeck::{crate_ctxt, write_substs_to_tcx, write_ty_to_tcx}; use core::result; use core::vec; use syntax::ast; -use syntax::codemap::span; -use syntax::print::pprust::path_to_str; -use util::common::indent; pub trait ast_conv { fn tcx() -> ty::ctxt; diff --git a/src/librustc/middle/typeck/check/_match.rs b/src/librustc/middle/typeck/check/_match.rs index 5514d2f04b3..7ff3dfcb073 100644 --- a/src/librustc/middle/typeck/check/_match.rs +++ b/src/librustc/middle/typeck/check/_match.rs @@ -8,23 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; -use middle::pat_util::{PatIdMap, pat_id_map, pat_is_binding, pat_is_const}; +use middle::pat_util::{pat_is_binding, pat_is_const}; use middle::pat_util::{pat_is_variant_or_struct}; use middle::ty; use middle::typeck::check::demand; -use middle::typeck::check::{check_block, check_expr_with, fn_ctxt}; -use middle::typeck::check::{instantiate_path, lookup_def, lookup_local}; -use middle::typeck::check::{structure_of, valid_range_bounds}; -use middle::typeck::require_same_types; use core::vec; use std::map::HashMap; use syntax::ast; use syntax::ast_util::walk_pat; use syntax::ast_util; -use syntax::codemap::span; use syntax::print::pprust; fn check_match(fcx: @fn_ctxt, diff --git a/src/librustc/middle/typeck/check/demand.rs b/src/librustc/middle/typeck/check/demand.rs index e4b232500bb..954608540f5 100644 --- a/src/librustc/middle/typeck/check/demand.rs +++ b/src/librustc/middle/typeck/check/demand.rs @@ -13,10 +13,8 @@ use middle::ty; use middle::typeck::check::fn_ctxt; use middle::typeck::infer; -use core::result::{Err, Ok}; use core::result; use syntax::ast; -use syntax::codemap::span; // Requires that the two types unify, and prints an error message if they // don't. diff --git a/src/librustc/middle/typeck/check/method.rs b/src/librustc/middle/typeck/check/method.rs index a8c1b0aaa90..f903270e15c 100644 --- a/src/librustc/middle/typeck/check/method.rs +++ b/src/librustc/middle/typeck/check/method.rs @@ -79,29 +79,20 @@ obtained the type `Foo`, we would never match this method. */ -use core::prelude::*; use middle::resolve::{Impl, MethodInfo}; use middle::resolve; use middle::ty::*; use middle::ty; -use middle::typeck::check::{fn_ctxt, impl_self_ty}; -use middle::typeck::check::{structurally_resolved_type}; -use middle::typeck::check::vtable::VtableContext; -use middle::typeck::check::vtable; use middle::typeck::check; +use middle::typeck::check::vtable; use middle::typeck::coherence::get_base_type_def_id; use middle::typeck::infer; -use middle::typeck::{method_map_entry, method_origin, method_param}; -use middle::typeck::{method_self, method_static, method_trait}; -use util::common::indenter; -use util::ppaux::expr_repr; use core::dvec::DVec; use core::result; use core::uint; use core::vec; -use std::map::HashMap; use syntax::ast::{def_id, sty_by_ref, sty_value, sty_region, sty_box}; use syntax::ast::{sty_uniq, sty_static, node_id, by_copy, by_ref}; use syntax::ast::{m_const, m_mutbl, m_imm}; @@ -109,7 +100,6 @@ use syntax::ast; use syntax::ast_map; use syntax::ast_map::node_id_to_str; use syntax::ast_util::dummy_sp; -use syntax::codemap::span; fn lookup( fcx: @fn_ctxt, diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index d0abd61697d..bd8b6934e0d 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -76,14 +76,11 @@ type parameter). */ -use core::prelude::*; use middle::capture; use middle::const_eval; -use middle::pat_util::pat_id_map; use middle::pat_util; -use middle::ty::{TyVid, vid, FnTyBase, FnMeta, FnSig, VariantInfo_, field}; -use middle::ty::{ty_param_bounds_and_ty, ty_param_substs_and_ty}; +use middle::ty::{TyVid, vid, FnTyBase, FnMeta, FnSig, VariantInfo_}; use middle::ty; use middle::typeck::astconv::{ast_conv, ast_path_to_ty}; use middle::typeck::astconv::{ast_region_to_region, ast_ty_to_ty}; @@ -92,18 +89,12 @@ use middle::typeck::check::_match::pat_ctxt; use middle::typeck::check::method::TransformTypeNormally; use middle::typeck::check::regionmanip::replace_bound_regions_in_fn_ty; use middle::typeck::check::vtable::{LocationInfo, VtableContext}; -use middle::typeck::crate_ctxt; use middle::typeck::infer::{resolve_type, force_tvar}; use middle::typeck::infer; use middle::typeck::rscope::{anon_rscope, binding_rscope, bound_self_region}; use middle::typeck::rscope::{empty_rscope, in_anon_rscope}; use middle::typeck::rscope::{in_binding_rscope, region_scope, type_rscope}; use middle::typeck::rscope; -use middle::typeck::{isr_alist, lookup_def_ccx, method_map_entry}; -use middle::typeck::{method_origin, method_self, method_trait, no_params}; -use middle::typeck::{require_same_types}; -use util::common::{block_query, indenter, loop_query}; -use util::ppaux::{bound_region_to_str, expr_repr}; use util::ppaux; use core::either; @@ -113,19 +104,15 @@ use core::result::{Result, Ok, Err}; use core::result; use core::str; use core::vec; -use std::list::Nil; use std::map::HashMap; use std::map; -use syntax::ast::{provided, required, spanned, ty_i}; +use syntax::ast::ty_i; use syntax::ast; use syntax::ast_map; -use syntax::ast_util::{Private, Public, is_local, local_def, respan}; -use syntax::ast_util::{visibility_to_privacy}; +use syntax::ast_util::{is_local, visibility_to_privacy, Private, Public}; use syntax::ast_util; -use syntax::codemap::span; use syntax::codemap; use syntax::parse::token::special_idents; -use syntax::print::pprust::{expr_to_str, pat_to_str}; use syntax::print::pprust; use syntax::visit; use syntax; @@ -144,15 +131,6 @@ export DerefArgs; export DontDerefArgs; export DoDerefArgs; export check_item_types; -export check_block; -export check_expr_with; -export fn_ctxt; -export lookup_def; -export structure_of; -export self_info; -export structurally_resolved_type; -export instantiate_path; -export valid_range_bounds; #[legacy_exports] pub mod _match; diff --git a/src/librustc/middle/typeck/check/regionck.rs b/src/librustc/middle/typeck/check/regionck.rs index 029a61c8ca6..c74b5789075 100644 --- a/src/librustc/middle/typeck/check/regionck.rs +++ b/src/librustc/middle/typeck/check/regionck.rs @@ -27,7 +27,6 @@ this point a bit better. */ -use core::prelude::*; use middle::freevars::get_freevars; use middle::pat_util::pat_bindings; @@ -35,17 +34,13 @@ use middle::ty::{encl_region, re_scope}; use middle::ty::{ty_fn_proto, vstore_box, vstore_fixed, vstore_slice}; use middle::ty::{vstore_uniq}; use middle::ty; -use middle::typeck::check::fn_ctxt; -use middle::typeck::check::lookup_def; -use middle::typeck::infer::{fres, resolve_and_force_all_but_regions}; -use middle::typeck::infer::{resolve_type}; +use middle::typeck::infer::{resolve_and_force_all_but_regions, fres}; use util::ppaux::{note_and_explain_region, ty_to_str}; use core::result; use syntax::ast::{ProtoBare, ProtoBox, ProtoUniq, ProtoBorrowed}; use syntax::ast::{def_arg, def_binding, def_local, def_self, def_upvar}; use syntax::ast; -use syntax::codemap::span; use syntax::print::pprust; use syntax::visit; diff --git a/src/librustc/middle/typeck/check/regionmanip.rs b/src/librustc/middle/typeck/check/regionmanip.rs index 1de37f79f08..c7000bb7e70 100644 --- a/src/librustc/middle/typeck/check/regionmanip.rs +++ b/src/librustc/middle/typeck/check/regionmanip.rs @@ -10,16 +10,9 @@ // #[warn(deprecated_mode)]; -use core::prelude::*; - use middle::ty; -use middle::typeck::check::self_info; -use middle::typeck::isr_alist; -use util::common::indenter; -use util::ppaux::region_to_str; use util::ppaux; -use std::list::Cons; use syntax::ast; use syntax::print::pprust::{expr_to_str}; diff --git a/src/librustc/middle/typeck/check/vtable.rs b/src/librustc/middle/typeck/check/vtable.rs index 593d32c644e..0872b1445c3 100644 --- a/src/librustc/middle/typeck/check/vtable.rs +++ b/src/librustc/middle/typeck/check/vtable.rs @@ -8,30 +8,23 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::resolve; use middle::ty; use middle::typeck::check::{fn_ctxt, impl_self_ty}; -use middle::typeck::check::{structurally_resolved_type}; use middle::typeck::infer::{fixup_err_to_str, infer_ctxt}; use middle::typeck::infer::{resolve_and_force_all_but_regions, resolve_type}; use middle::typeck::infer; -use middle::typeck::{crate_ctxt, vtable_origin, vtable_param, vtable_res}; -use middle::typeck::{vtable_static, vtable_trait}; use util::common::indenter; -use util::ppaux::tys_to_str; use util::ppaux; use core::result; use core::uint; use core::vec; use result::{Result, Ok, Err}; -use std::map::HashMap; use syntax::ast; use syntax::ast_util; use syntax::codemap::span; -use syntax::print::pprust::expr_to_str; use syntax::print::pprust; use syntax::visit; diff --git a/src/librustc/middle/typeck/check/writeback.rs b/src/librustc/middle/typeck/check/writeback.rs index a00fe073c54..623c280ac22 100644 --- a/src/librustc/middle/typeck/check/writeback.rs +++ b/src/librustc/middle/typeck/check/writeback.rs @@ -12,24 +12,18 @@ // unresolved type variables and replaces "ty_var" types with their // substitutions. -use core::prelude::*; use middle::pat_util; use middle::ty; -use middle::typeck::check::{fn_ctxt, lookup_local, self_info}; +use middle::typeck::check::{fn_ctxt, lookup_local}; use middle::typeck::infer::{force_all, resolve_all, resolve_region}; use middle::typeck::infer::{resolve_type}; use middle::typeck::infer; -use middle::typeck::{vtable_param, vtable_trait, write_substs_to_tcx}; -use middle::typeck::{write_ty_to_tcx}; use util::ppaux; use core::result::{Result, Ok, Err}; use core::vec; -use std::map::HashMap; use syntax::ast; -use syntax::codemap::span; -use syntax::print::pprust::pat_to_str; use syntax::visit; export resolve_type_vars_in_fn; diff --git a/src/librustc/middle/typeck/coherence.rs b/src/librustc/middle/typeck/coherence.rs index d25c91dfe47..0116214b5f9 100644 --- a/src/librustc/middle/typeck/coherence.rs +++ b/src/librustc/middle/typeck/coherence.rs @@ -14,7 +14,6 @@ // has at most one implementation for each type. Then we build a mapping from // each trait in the system to its implementations. -use core::prelude::*; use driver; use metadata::csearch::{ProvidedTraitMethodInfo, each_path, get_impl_traits}; @@ -26,14 +25,12 @@ use middle::resolve::{Impl, MethodInfo}; use middle::ty::{ProvidedMethodSource, ProvidedMethodInfo, bound_copy, get}; use middle::ty::{kind_can_be_copied, lookup_item_type, param_bounds, subst}; use middle::ty::{t, ty_bool, ty_bot, ty_box, ty_enum, ty_err, ty_estr}; -use middle::ty::{ty_evec, ty_float, ty_fn, ty_infer, ty_int, ty_nil}; -use middle::ty::{ty_opaque_box, ty_param, ty_param_bounds_and_ty, ty_ptr}; -use middle::ty::{ty_rec, ty_rptr, ty_self, ty_struct, ty_trait, ty_tup}; -use middle::ty::{ty_type, ty_uint, ty_uniq}; +use middle::ty::{ty_evec, ty_float, ty_fn, ty_infer, ty_int, ty_nil, ty_ptr}; +use middle::ty::{ty_rec, ty_rptr, ty_struct, ty_trait, ty_tup, ty_uint}; +use middle::ty::{ty_param, ty_self, ty_type, ty_opaque_box, ty_uniq}; use middle::ty::{ty_opaque_closure_ptr, ty_unboxed_vec, type_kind_ext}; use middle::ty::{type_is_ty_var}; use middle::ty; -use middle::typeck::crate_ctxt; use middle::typeck::infer::{infer_ctxt, can_mk_subty}; use middle::typeck::infer::{new_infer_ctxt, resolve_ivar}; use middle::typeck::infer::{resolve_nested_tvar, resolve_type}; @@ -45,7 +42,7 @@ use syntax::ast::{trait_ref}; use syntax::ast; use syntax::ast_map::node_item; use syntax::ast_map; -use syntax::ast_util::{def_id_of_def, dummy_sp, local_def}; +use syntax::ast_util::{def_id_of_def, dummy_sp}; use syntax::attr; use syntax::codemap::span; use syntax::parse; diff --git a/src/librustc/middle/typeck/collect.rs b/src/librustc/middle/typeck/collect.rs index 11a932db287..e8d424b899f 100644 --- a/src/librustc/middle/typeck/collect.rs +++ b/src/librustc/middle/typeck/collect.rs @@ -30,11 +30,8 @@ are represented as `ty_param()` instances. */ -use core::prelude::*; - use metadata::csearch; use middle::ty::{FnMeta, FnSig, FnTyBase, InstantiatedTraitRef}; -use middle::ty::{ty_param_substs_and_ty}; use middle::ty; use middle::typeck::astconv::{ast_conv, ty_of_fn_decl, ty_of_arg}; use middle::typeck::astconv::{ast_ty_to_ty}; @@ -42,8 +39,7 @@ use middle::typeck::astconv; use middle::typeck::infer; use middle::typeck::rscope::*; use middle::typeck::rscope; -use middle::typeck::{crate_ctxt, lookup_def_tcx, no_params, write_ty_to_tcx}; -use util::common::{indenter, pluralize}; +use util::common::pluralize; use util::ppaux; use util::ppaux::bound_to_str; @@ -52,12 +48,9 @@ use core::option; use core::vec; use syntax::ast; use syntax::ast_map; -use syntax::ast_util::{local_def, split_trait_methods}; -use syntax::ast_util::{trait_method_to_ty_method}; +use syntax::ast_util::trait_method_to_ty_method; use syntax::ast_util; -use syntax::codemap::span; use syntax::codemap; -use syntax::print::pprust::path_to_str; use syntax::visit; fn collect_item_types(ccx: @crate_ctxt, crate: @ast::crate) { diff --git a/src/librustc/middle/typeck/infer/assignment.rs b/src/librustc/middle/typeck/infer/assignment.rs index 8e524bb8019..8eb3e0336df 100644 --- a/src/librustc/middle/typeck/infer/assignment.rs +++ b/src/librustc/middle/typeck/infer/assignment.rs @@ -58,18 +58,12 @@ // A. But this upper-bound might be stricter than what is truly // needed. -use core::prelude::*; -use middle::ty::TyVar; use middle::ty; -use middle::typeck::infer::{ares, cres}; use middle::typeck::infer::combine::combine_fields; -use middle::typeck::infer::sub::Sub; use middle::typeck::infer::to_str::ToStr; -use util::common::{indent, indenter}; use core::option; -use syntax::ast::{m_const, m_imm, m_mutbl}; use syntax::ast; fn to_ares(+c: cres<ty::t>) -> ares { diff --git a/src/librustc/middle/typeck/infer/combine.rs b/src/librustc/middle/typeck/infer/combine.rs index d0b17d2ddc3..f790939f4e7 100644 --- a/src/librustc/middle/typeck/infer/combine.rs +++ b/src/librustc/middle/typeck/infer/combine.rs @@ -54,22 +54,14 @@ // terms of error reporting, although we do not do that properly right // now. -use core::prelude::*; - -use middle::ty::{FloatVar, FnTyBase, FnMeta, FnSig, IntVar, TyVar}; use middle::ty; -use middle::typeck::infer::glb::Glb; -use middle::typeck::infer::lub::Lub; +use middle::ty::{FnTyBase, FnMeta, FnSig}; use middle::typeck::infer::sub::Sub; use middle::typeck::infer::to_str::ToStr; -use middle::typeck::infer::{cres, infer_ctxt, ures}; -use util::common::indent; -use core::result::{iter_vec2, map_vec2}; use core::vec; -use syntax::ast::{Onceness, purity, ret_style}; +use syntax::ast::Onceness; use syntax::ast; -use syntax::codemap::span; fn macros() { include!("macros.rs"); } // FIXME(#3114): Macro import/export. diff --git a/src/librustc/middle/typeck/infer/floating.rs b/src/librustc/middle/typeck/infer/floating.rs index 68adeeb82db..85a11a598e9 100644 --- a/src/librustc/middle/typeck/infer/floating.rs +++ b/src/librustc/middle/typeck/infer/floating.rs @@ -14,10 +14,9 @@ Code related to floating-point type inference. */ -use core::prelude::*; -use middle::ty::{get, ty_float}; use middle::ty; +use middle::ty::ty_float; use middle::typeck::infer::to_str::ToStr; use core::uint; diff --git a/src/librustc/middle/typeck/infer/glb.rs b/src/librustc/middle/typeck/infer/glb.rs index 62be4488796..920b058770a 100644 --- a/src/librustc/middle/typeck/infer/glb.rs +++ b/src/librustc/middle/typeck/infer/glb.rs @@ -8,21 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::ty; use middle::typeck::infer::combine::*; use middle::typeck::infer::lattice::*; -use middle::typeck::infer::glb::Glb; -use middle::typeck::infer::lub::Lub; use middle::typeck::infer::sub::Sub; use middle::typeck::infer::to_str::ToStr; -use syntax::ast::{Many, Once, extern_fn, impure_fn, m_const, m_imm, m_mutbl}; -use syntax::ast::{noreturn, pure_fn, ret_style, return_val, unsafe_fn}; -use util::ppaux::mt_to_str; use std::list; +use syntax::ast::{Many, Once}; + enum Glb = combine_fields; // "greatest lower bound" (common subtype) impl Glb: combine { diff --git a/src/librustc/middle/typeck/infer/integral.rs b/src/librustc/middle/typeck/infer/integral.rs index aa67c1371f9..e6701182342 100644 --- a/src/librustc/middle/typeck/infer/integral.rs +++ b/src/librustc/middle/typeck/infer/integral.rs @@ -14,9 +14,6 @@ Code related to integral type inference. */ -use core::prelude::*; - -use middle::ty::{get, ty_int, ty_uint}; use middle::ty; use middle::typeck::infer::to_str::ToStr; diff --git a/src/librustc/middle/typeck/infer/lattice.rs b/src/librustc/middle/typeck/infer/lattice.rs index 47343f8b48b..ea994c238c6 100644 --- a/src/librustc/middle/typeck/infer/lattice.rs +++ b/src/librustc/middle/typeck/infer/lattice.rs @@ -8,14 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; -use middle::ty::TyVar; use middle::ty; -use middle::typeck::infer::*; use middle::typeck::infer::combine::*; -use middle::typeck::infer::glb::Glb; -use middle::typeck::infer::lub::Lub; use middle::typeck::infer::unify::*; use middle::typeck::infer::to_str::ToStr; diff --git a/src/librustc/middle/typeck/infer/lub.rs b/src/librustc/middle/typeck/infer/lub.rs index d478e8d9b92..10ac6a3add9 100644 --- a/src/librustc/middle/typeck/infer/lub.rs +++ b/src/librustc/middle/typeck/infer/lub.rs @@ -8,21 +8,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; -use middle::ty::RegionVid; use middle::ty; use middle::typeck::infer::combine::*; -use middle::typeck::infer::glb::Glb; use middle::typeck::infer::lattice::*; use middle::typeck::infer::sub::Sub; use middle::typeck::infer::to_str::ToStr; -use middle::typeck::isr_alist; -use util::ppaux::mt_to_str; use std::list; -use syntax::ast::{Many, Once, extern_fn, m_const, impure_fn, noreturn}; -use syntax::ast::{pure_fn, ret_style, return_val, unsafe_fn}; +use syntax::ast::{Many, Once}; fn macros() { include!("macros.rs"); } // FIXME(#3114): Macro import/export. diff --git a/src/librustc/middle/typeck/infer/mod.rs b/src/librustc/middle/typeck/infer/mod.rs index 51e0a5186e8..7d6a2c4366e 100644 --- a/src/librustc/middle/typeck/infer/mod.rs +++ b/src/librustc/middle/typeck/infer/mod.rs @@ -259,8 +259,6 @@ section on "Type Combining" below for details. #[warn(deprecated_mode)]; #[warn(deprecated_pattern)]; -use core::prelude::*; - use middle::ty::{TyVid, IntVid, FloatVid, RegionVid, vid}; use middle::ty::{mk_fn, type_is_bot}; use middle::ty::{ty_int, ty_uint, get, terr_fn, TyVar, IntVar, FloatVar}; @@ -282,25 +280,21 @@ use middle::typeck::infer::resolve::{resolver}; use middle::typeck::infer::sub::Sub; use middle::typeck::infer::to_str::ToStr; use middle::typeck::infer::unify::{vals_and_bindings, root}; -use middle::typeck::isr_alist; use util::common::{indent, indenter}; -use util::ppaux::{bound_region_to_str, ty_to_str, mt_to_str}; +use util::ppaux::{ty_to_str, mt_to_str}; use core::cmp::Eq; use core::dvec::DVec; use core::result::{Result, Ok, Err, map_vec, map_vec2, iter_vec2}; use core::result; use core::vec; -use std::list::Nil; use std::map::HashMap; use std::smallintmap; use syntax::ast::{ret_style, purity}; use syntax::ast::{m_const, m_imm, m_mutbl}; use syntax::ast::{unsafe_fn, impure_fn, pure_fn, extern_fn}; -use syntax::ast; use syntax::ast_util::dummy_sp; -use syntax::ast_util; -use syntax::codemap::span; +use syntax::{ast, ast_util}; export infer_ctxt; export new_infer_ctxt; @@ -331,13 +325,6 @@ export resolve; export sub; export to_str; export unify; -export uok; -export cyclic_ty, unresolved_ty, region_var_bound_by_region_var; -export bound, bounds; -export ures; -export ares; -export infer_ctxt; -export fixup_err; #[legacy_exports] mod assignment; @@ -570,7 +557,7 @@ impl<T:Copy Eq> cres<T>: CresCompare<T> { } } -pub fn uok() -> ures { +fn uok() -> ures { Ok(()) } diff --git a/src/librustc/middle/typeck/infer/region_inference.rs b/src/librustc/middle/typeck/infer/region_inference.rs index 0d9c90e454c..e5ca30a3e2c 100644 --- a/src/librustc/middle/typeck/infer/region_inference.rs +++ b/src/librustc/middle/typeck/infer/region_inference.rs @@ -539,16 +539,13 @@ more convincing in the future. #[warn(deprecated_mode)]; #[warn(deprecated_pattern)]; -use core::prelude::*; - use middle::region::is_subregion_of; use middle::region; use middle::ty; -use middle::ty::{Region, RegionVid, br_fresh, re_bound, re_free, re_infer}; -use middle::ty::{re_scope, re_static, ReVar, ReSkolemized}; -use middle::typeck::infer::cres; +use middle::ty::{Region, RegionVid, re_static, re_infer, re_free, re_bound}; +use middle::ty::{re_scope, ReVar, ReSkolemized, br_fresh}; use middle::typeck::infer::to_str::ToStr; -use util::common::indenter; +use syntax::codemap; use util::ppaux::note_and_explain_region; use core::cmp; @@ -561,8 +558,6 @@ use result::{Ok, Err}; use std::map::HashMap; use std::cell::{Cell, empty_cell}; use std::list::{List, Nil, Cons}; -use syntax::codemap::span; -use syntax::codemap; export RegionVarBindings; export make_subregion; diff --git a/src/librustc/middle/typeck/infer/resolve.rs b/src/librustc/middle/typeck/infer/resolve.rs index 68e589cab27..da4c02b9e35 100644 --- a/src/librustc/middle/typeck/infer/resolve.rs +++ b/src/librustc/middle/typeck/infer/resolve.rs @@ -46,21 +46,13 @@ // future). If you want to resolve everything but one type, you are // probably better off writing `resolve_all - resolve_ivar`. -use core::prelude::*; -use middle::ty::{FloatVar, FloatVid, IntVar, IntVid, RegionVid, TyVar, TyVid}; -use middle::ty::{type_is_bot}; use middle::ty; -use middle::typeck::infer::{cyclic_ty, fixup_err, fres, infer_ctxt}; -use middle::typeck::infer::{region_var_bound_by_region_var, unresolved_ty}; use middle::typeck::infer::floating::*; use middle::typeck::infer::floating; use middle::typeck::infer::integral::*; use middle::typeck::infer::integral; use middle::typeck::infer::to_str::ToStr; -use middle::typeck::infer::unify::root; -use util::common::indent; -use util::ppaux::ty_to_str; use core::uint; use core::vec; diff --git a/src/librustc/middle/typeck/infer/sub.rs b/src/librustc/middle/typeck/infer/sub.rs index 79405e955f5..c96724bd652 100644 --- a/src/librustc/middle/typeck/infer/sub.rs +++ b/src/librustc/middle/typeck/infer/sub.rs @@ -8,22 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::ty; -use middle::typeck::check::regionmanip::replace_bound_regions_in_fn_ty; use middle::typeck::infer::combine::*; -use middle::typeck::infer::cres; -use middle::typeck::infer::glb::Glb; -use middle::typeck::infer::infer_ctxt; -use middle::typeck::infer::lub::Lub; use middle::typeck::infer::to_str::ToStr; use middle::typeck::infer::unify::*; -use util::ppaux::bound_region_to_str; -use std::list::Nil; use std::list; -use syntax::ast::{m_const, purity, ret_style}; fn macros() { include!("macros.rs"); } // FIXME(#3114): Macro import/export. diff --git a/src/librustc/middle/typeck/infer/test.rs b/src/librustc/middle/typeck/infer/test.rs index 5f85d6c4268..abc249a45ec 100644 --- a/src/librustc/middle/typeck/infer/test.rs +++ b/src/librustc/middle/typeck/infer/test.rs @@ -16,24 +16,22 @@ Note: This module is only compiled when doing unit testing. */ -use core::prelude::*; - -use driver::diagnostic; -use driver::driver::{optgroups, build_session_options, build_session}; -use driver::driver::{str_input, build_configuration}; -use middle::lang_items::{LanguageItems, language_items}; -use middle::ty::{FnTyBase, FnMeta, FnSig}; -use util::ppaux::ty_to_str; - -use std::getopts::groups::{optopt, optmulti, optflag, optflagopt, getopts}; -use std::getopts::groups; -use std::getopts::{opt_present}; -use std::getopts; +use dvec::DVec; use std::getopts; use std::map::HashMap; -use syntax::ast_util::dummy_sp; -use syntax::parse::parse_crate_from_source_str; +use std::getopts; +use std::getopts::{opt_present}; +use std::getopts::groups; +use std::getopts::groups::{optopt, optmulti, optflag, optflagopt, getopts}; +use driver::driver::{optgroups, build_session_options, build_session, + str_input, build_configuration}; +use driver::diagnostic; use syntax::{ast, attr, parse}; +use syntax::parse::parse_crate_from_source_str; +use middle::lang_items::LanguageItems; +use util::ppaux::ty_to_str; +use syntax::ast_util::dummy_sp; +use middle::ty::{FnTyBase, FnMeta, FnSig}; struct Env { crate: @ast::crate, diff --git a/src/librustc/middle/typeck/infer/to_str.rs b/src/librustc/middle/typeck/infer/to_str.rs index 0a1647eb09a..73352b802d6 100644 --- a/src/librustc/middle/typeck/infer/to_str.rs +++ b/src/librustc/middle/typeck/infer/to_str.rs @@ -8,16 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; -use middle::ty::vid; use middle::ty; -use middle::typeck::infer::{bound, bounds}; -use middle::typeck::infer::floating::float_ty_set; -use middle::typeck::infer::infer_ctxt; use middle::typeck::infer::integral::int_ty_set; +use middle::typeck::infer::floating::float_ty_set; use middle::typeck::infer::unify::{redirect, root, var_value}; -use util::ppaux::{mt_to_str, ty_to_str}; use util::ppaux; use core::uint; diff --git a/src/librustc/middle/typeck/infer/unify.rs b/src/librustc/middle/typeck/infer/unify.rs index 633ff706a26..8056c2c6bb3 100644 --- a/src/librustc/middle/typeck/infer/unify.rs +++ b/src/librustc/middle/typeck/infer/unify.rs @@ -8,19 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; -use middle::ty::vid; use middle::ty; -use middle::typeck::infer::{bound, bounds, cres, uok, ures}; use middle::typeck::infer::combine::combine; use middle::typeck::infer::floating::*; use middle::typeck::infer::floating; -use middle::typeck::infer::infer_ctxt; use middle::typeck::infer::integral::*; use middle::typeck::infer::integral; use middle::typeck::infer::to_str::ToStr; -use util::common::{indent, indenter}; use core::result; use std::smallintmap::SmallIntMap; diff --git a/src/librustc/middle/typeck/mod.rs b/src/librustc/middle/typeck/mod.rs index f922e83a164..adb6fc8baf7 100644 --- a/src/librustc/middle/typeck/mod.rs +++ b/src/librustc/middle/typeck/mod.rs @@ -50,8 +50,6 @@ independently: #[legacy_exports]; -use core::prelude::*; - use metadata::csearch; use middle::pat_util::{pat_id_map, PatIdMap}; use middle::resolve; @@ -101,12 +99,6 @@ export infer; export collect; export coherence; export deriving; -export crate_ctxt; -export write_ty_to_tcx, write_substs_to_tcx; -export no_params; -export isr_alist; -export require_same_types; -export lookup_def_ccx, lookup_def_tcx; #[legacy_exports] #[path = "check/mod.rs"] @@ -233,7 +225,7 @@ struct crate_ctxt__ { tcx: ty::ctxt } -pub enum crate_ctxt { +enum crate_ctxt { crate_ctxt_(crate_ctxt__) } diff --git a/src/librustc/middle/typeck/rscope.rs b/src/librustc/middle/typeck/rscope.rs index f1655f2a363..ecd73b4783a 100644 --- a/src/librustc/middle/typeck/rscope.rs +++ b/src/librustc/middle/typeck/rscope.rs @@ -8,14 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::ty; use core::result::Result; use core::result; use syntax::ast; -use syntax::codemap::span; use syntax::parse::token::special_idents; trait region_scope { diff --git a/src/librustc/util/common.rs b/src/librustc/util/common.rs index 1a556c32bf3..cd71bb099fe 100644 --- a/src/librustc/util/common.rs +++ b/src/librustc/util/common.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use syntax::ast; use syntax::codemap::{span}; diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index ebb75de8626..071f12a92d4 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; use middle::ty; use middle::ty::{arg, canon_mode}; diff --git a/src/librustdoc/astsrv.rs b/src/librustdoc/astsrv.rs index 99cf301f182..83516a589b5 100644 --- a/src/librustdoc/astsrv.rs +++ b/src/librustdoc/astsrv.rs @@ -17,8 +17,6 @@ query AST-related information, shielding the rest of Rustdoc from its non-sendableness. */ -use core::prelude::*; - use parse; use util; diff --git a/src/librustdoc/attr_parser.rs b/src/librustdoc/attr_parser.rs index aa6e40ab1d1..e47bdbb00da 100644 --- a/src/librustdoc/attr_parser.rs +++ b/src/librustdoc/attr_parser.rs @@ -15,8 +15,6 @@ The attribute parser provides methods for pulling documentation out of an AST's attributes. */ -use core::prelude::*; - use core::str; use core::tuple; use core::vec; @@ -31,12 +29,12 @@ pub type CrateAttrs = { #[cfg(test)] mod test { + #[legacy_exports]; + use syntax::ast; use syntax; - use core::option::None; - - pub fn parse_attributes(+source: ~str) -> ~[ast::attribute] { + fn parse_attributes(+source: ~str) -> ~[ast::attribute] { use syntax::parse; use syntax::parse::parser; use syntax::parse::attr::parser_attr; diff --git a/src/librustdoc/attr_pass.rs b/src/librustdoc/attr_pass.rs index 530f9f22666..8e52fb25a94 100644 --- a/src/librustdoc/attr_pass.rs +++ b/src/librustdoc/attr_pass.rs @@ -16,8 +16,6 @@ corresponding AST nodes. The information gathered here is the basis of the natural-language documentation for a crate. */ -use core::prelude::*; - use astsrv; use attr_parser; use doc::ItemUtils; @@ -25,7 +23,6 @@ use doc; use extract::to_str; use fold::Fold; use fold; -use pass::Pass; use core::option; use core::vec; @@ -41,7 +38,7 @@ pub fn mk_pass() -> Pass { } } -pub fn run( +fn run( srv: astsrv::Srv, +doc: doc::Doc ) -> doc::Doc { @@ -312,12 +309,13 @@ fn should_extract_impl_method_docs() { #[cfg(test)] mod test { + #[legacy_exports]; + use astsrv; - use attr_pass::run; use doc; use extract; - pub fn mk_doc(source: ~str) -> doc::Doc { + fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); run(srv, doc) diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index ebd5c047df3..94b3a966184 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use core::cmp; use core::os; use core::result; @@ -58,7 +56,7 @@ pub type Config = { pandoc_cmd: Option<~str> }; -pub impl Config: Clone { +impl Config: Clone { fn clone(&self) -> Config { copy *self } } @@ -107,7 +105,7 @@ pub fn default_config(input_crate: &Path) -> Config { type ProgramOutput = fn~((&str), (&[~str])) -> {status: int, out: ~str, err: ~str}; -pub fn mock_program_output(_prog: &str, _args: &[~str]) -> { +fn mock_program_output(_prog: &str, _args: &[~str]) -> { status: int, out: ~str, err: ~str } { { @@ -121,7 +119,7 @@ pub fn parse_config(args: &[~str]) -> Result<Config, ~str> { parse_config_(args, run::program_output) } -pub fn parse_config_( +fn parse_config_( args: &[~str], +program_output: ProgramOutput ) -> Result<Config, ~str> { @@ -290,11 +288,8 @@ fn should_error_with_no_pandoc() { #[cfg(test)] mod test { - use config::{Config, mock_program_output, parse_config_}; - - use core::result::Result; - - pub fn parse_config(args: &[~str]) -> Result<Config, ~str> { + #[legacy_exports]; + fn parse_config(args: &[~str]) -> Result<Config, ~str> { parse_config_(args, mock_program_output) } } diff --git a/src/librustdoc/demo.rs b/src/librustdoc/demo.rs index bb8f37dc7ad..d7b50595580 100644 --- a/src/librustdoc/demo.rs +++ b/src/librustdoc/demo.rs @@ -21,8 +21,6 @@ * tests on this file */ -use core::prelude::*; - /// The base price of a muffin on a non-holiday const price_of_a_muffin: float = 70f; diff --git a/src/librustdoc/desc_to_brief_pass.rs b/src/librustdoc/desc_to_brief_pass.rs index 97caa71d692..2c3998cecee 100644 --- a/src/librustdoc/desc_to_brief_pass.rs +++ b/src/librustdoc/desc_to_brief_pass.rs @@ -15,14 +15,11 @@ If the first paragraph of a long description is short enough then it is interpreted as the brief description. */ -use core::prelude::*; - use astsrv; use doc::ItemUtils; use doc; use fold::Fold; use fold; -use pass::Pass; use core::str; use core::vec; @@ -35,7 +32,7 @@ pub fn mk_pass() -> Pass { } } -pub fn run( +fn run( _srv: astsrv::Srv, +doc: doc::Doc ) -> doc::Doc { @@ -101,14 +98,15 @@ fn should_promote_impl_method_desc() { } #[cfg(test)] -pub mod test { +mod test { + #[legacy_exports]; + use astsrv; use attr_pass; - use desc_to_brief_pass::run; use doc; use extract; - pub fn mk_doc(source: ~str) -> doc::Doc { + fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); let doc = (attr_pass::mk_pass().f)(srv, doc); diff --git a/src/librustdoc/doc.rs b/src/librustdoc/doc.rs index 18742720b90..4b5f82235dd 100644 --- a/src/librustdoc/doc.rs +++ b/src/librustdoc/doc.rs @@ -10,10 +10,7 @@ //! The document model -use core::prelude::*; - use doc; -use pass::Pass; use core::cmp; use core::option; diff --git a/src/librustdoc/escape_pass.rs b/src/librustdoc/escape_pass.rs index 6e000444865..46b21063774 100644 --- a/src/librustdoc/escape_pass.rs +++ b/src/librustdoc/escape_pass.rs @@ -10,7 +10,6 @@ //! Escapes text sequences -use pass::Pass; use text_pass; use core::str; diff --git a/src/librustdoc/extract.rs b/src/librustdoc/extract.rs index 444949cfb7f..8f2c61ba26e 100644 --- a/src/librustdoc/extract.rs +++ b/src/librustdoc/extract.rs @@ -10,8 +10,6 @@ //! Converts the Rust AST to the rustdoc document model -use core::prelude::*; - use astsrv; use doc::ItemUtils; use doc; @@ -348,7 +346,6 @@ mod test { use astsrv; use doc; - use extract::{extract, from_srv}; use parse; use core::vec; diff --git a/src/librustdoc/fold.rs b/src/librustdoc/fold.rs index 29c53e0af25..deb6af224e5 100644 --- a/src/librustdoc/fold.rs +++ b/src/librustdoc/fold.rs @@ -8,13 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use astsrv; use doc; use extract; use parse; -use pass::Pass; use core::vec; use std::par; diff --git a/src/librustdoc/markdown_index_pass.rs b/src/librustdoc/markdown_index_pass.rs index 881352c9c77..1408ae87416 100644 --- a/src/librustdoc/markdown_index_pass.rs +++ b/src/librustdoc/markdown_index_pass.rs @@ -10,8 +10,6 @@ //! Build indexes as appropriate for the markdown pass -use core::prelude::*; - use astsrv; use config; use doc::ItemUtils; @@ -20,7 +18,6 @@ use fold::Fold; use fold; use markdown_pass; use markdown_writer; -use pass::Pass; use core::str; use std::par; @@ -34,7 +31,7 @@ pub fn mk_pass(+config: config::Config) -> Pass { } } -pub fn run( +fn run( _srv: astsrv::Srv, +doc: doc::Doc, +config: config::Config @@ -254,19 +251,17 @@ fn should_index_foreign_mod_contents() { #[cfg(test)] mod test { + #[legacy_exports]; + use astsrv; use attr_pass; use config; use desc_to_brief_pass; use doc; use extract; - use markdown_index_pass::run; use path_pass; - use core::path::Path; - - pub fn mk_doc(output_style: config::OutputStyle, +source: ~str) - -> doc::Doc { + fn mk_doc(output_style: config::OutputStyle, +source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let config = { output_style: output_style, diff --git a/src/librustdoc/markdown_pass.rs b/src/librustdoc/markdown_pass.rs index ad100b9b4e8..fd3cf86df27 100644 --- a/src/librustdoc/markdown_pass.rs +++ b/src/librustdoc/markdown_pass.rs @@ -10,8 +10,6 @@ //! Generate markdown from a document tree -use core::prelude::*; - use astsrv; use attr_pass; use config; @@ -27,7 +25,6 @@ use markdown_writer::WriterUtils; use markdown_writer::WriterFactory; use markdown_writer; use page_pass; -use pass::Pass; use path_pass; use sectionalize_pass; use sort_pass; @@ -114,7 +111,7 @@ type Ctxt = { w: Writer }; -pub fn write_markdown( +fn write_markdown( +doc: doc::Doc, +writer_factory: WriterFactory ) { @@ -841,7 +838,6 @@ mod test { use doc; use extract; use markdown_index_pass; - use markdown_pass::{mk_pass, write_markdown}; use markdown_writer; use path_pass; use sectionalize_pass; @@ -850,7 +846,6 @@ mod test { use unindent_pass; use core::oldcomm; - use core::path::Path; use core::str; fn render(+source: ~str) -> ~str { diff --git a/src/librustdoc/markdown_writer.rs b/src/librustdoc/markdown_writer.rs index b701b674083..f4e5db304e7 100644 --- a/src/librustdoc/markdown_writer.rs +++ b/src/librustdoc/markdown_writer.rs @@ -8,12 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use config; use doc::ItemUtils; use doc; -use pass::Pass; use core::io::ReaderUtil; use core::io; diff --git a/src/librustdoc/page_pass.rs b/src/librustdoc/page_pass.rs index e099beef7b6..0709cc5dc55 100644 --- a/src/librustdoc/page_pass.rs +++ b/src/librustdoc/page_pass.rs @@ -15,15 +15,12 @@ Each page corresponds is a logical section. There may be pages for individual modules, pages for the crate, indexes, etc. */ -use core::prelude::*; - use astsrv; use config; use doc::{ItemUtils, PageUtils}; use doc; use fold::Fold; use fold; -use pass::Pass; use sort_pass; use util::NominalOp; use util; @@ -42,7 +39,7 @@ pub fn mk_pass(output_style: config::OutputStyle) -> Pass { } } -pub fn run( +fn run( _srv: astsrv::Srv, +doc: doc::Doc, output_style: config::OutputStyle @@ -185,13 +182,14 @@ fn should_remove_foreign_mods_from_containing_mods() { #[cfg(test)] mod test { + #[legacy_exports]; + use astsrv; use config; use doc; use extract; - use page_pass::run; - pub fn mk_doc_( + fn mk_doc_( output_style: config::OutputStyle, source: ~str ) -> doc::Doc { @@ -201,7 +199,7 @@ mod test { } } - pub fn mk_doc(source: ~str) -> doc::Doc { + fn mk_doc(source: ~str) -> doc::Doc { mk_doc_(config::DocPerMod, source) } } diff --git a/src/librustdoc/parse.rs b/src/librustdoc/parse.rs index 48eb3d47a16..db97f34f201 100644 --- a/src/librustdoc/parse.rs +++ b/src/librustdoc/parse.rs @@ -10,8 +10,6 @@ //! AST-parsing helpers -use core::prelude::*; - use rustc::driver::driver::{file_input, str_input}; use rustc::driver::driver; use rustc::driver::session; diff --git a/src/librustdoc/pass.rs b/src/librustdoc/pass.rs index e6b85ca9d64..967dcd8f49f 100644 --- a/src/librustdoc/pass.rs +++ b/src/librustdoc/pass.rs @@ -8,12 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use astsrv; use doc; use extract; -use time; use core::vec; diff --git a/src/librustdoc/path_pass.rs b/src/librustdoc/path_pass.rs index 01ea26e1ad0..4227ce23096 100644 --- a/src/librustdoc/path_pass.rs +++ b/src/librustdoc/path_pass.rs @@ -10,15 +10,12 @@ //! Records the full path to items -use core::prelude::*; - use astsrv; use doc::ItemUtils; use doc; use extract; use fold::Fold; use fold; -use pass::Pass; use syntax::ast; diff --git a/src/librustdoc/prune_hidden_pass.rs b/src/librustdoc/prune_hidden_pass.rs index c87cc6f7d8c..da3c6bd7f2b 100644 --- a/src/librustdoc/prune_hidden_pass.rs +++ b/src/librustdoc/prune_hidden_pass.rs @@ -16,7 +16,6 @@ use doc::ItemUtils; use doc; use fold::Fold; use fold; -use pass::Pass; use core::vec; use std::map::HashMap; @@ -28,7 +27,7 @@ pub fn mk_pass() -> Pass { } } -pub fn run(srv: astsrv::Srv, +doc: doc::Doc) -> doc::Doc { +fn run(srv: astsrv::Srv, +doc: doc::Doc) -> doc::Doc { let fold = Fold { fold_mod: fold_mod, .. fold::default_any_fold(srv) @@ -70,13 +69,14 @@ fn should_prune_hidden_items() { } #[cfg(test)] -pub mod test { +mod test { + #[legacy_exports]; + use astsrv; use doc; use extract; - use prune_hidden_pass::run; - pub fn mk_doc(source: ~str) -> doc::Doc { + fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); run(srv, doc) diff --git a/src/librustdoc/prune_private_pass.rs b/src/librustdoc/prune_private_pass.rs index 25613acbb35..5017f889d5a 100644 --- a/src/librustdoc/prune_private_pass.rs +++ b/src/librustdoc/prune_private_pass.rs @@ -12,20 +12,16 @@ #[legacy_exports]; -use core::prelude::*; - use astsrv; use doc; use fold::Fold; use fold; -use pass::Pass; use core::util; use core::vec; use syntax::ast; export mk_pass; -export run; fn mk_pass() -> Pass { { @@ -34,7 +30,7 @@ fn mk_pass() -> Pass { } } -pub fn run(srv: astsrv::Srv, +doc: doc::Doc) -> doc::Doc { +fn run(srv: astsrv::Srv, +doc: doc::Doc) -> doc::Doc { let fold = Fold { fold_mod: fold_mod, .. fold::default_any_fold(srv) @@ -79,11 +75,10 @@ fn should_prune_items_without_pub_modifier() { } #[cfg(test)] -pub mod test { +mod test { use astsrv; use doc; use extract; - use prune_private_pass::run; pub fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { diff --git a/src/librustdoc/sectionalize_pass.rs b/src/librustdoc/sectionalize_pass.rs index a9cb8aa1e5d..a2b66875220 100644 --- a/src/librustdoc/sectionalize_pass.rs +++ b/src/librustdoc/sectionalize_pass.rs @@ -10,8 +10,6 @@ //! Breaks rustdocs into sections according to their headers -use core::prelude::*; - use astsrv; use attr_pass; use doc::ItemUtils; @@ -19,7 +17,6 @@ use doc; use extract; use fold::Fold; use fold; -use pass::Pass; use core::str; use core::vec; @@ -32,7 +29,7 @@ pub fn mk_pass() -> Pass { } } -pub fn run(_srv: astsrv::Srv, +doc: doc::Doc) -> doc::Doc { +fn run(_srv: astsrv::Srv, +doc: doc::Doc) -> doc::Doc { let fold = Fold { fold_item: fold_item, fold_trait: fold_trait, @@ -252,14 +249,15 @@ fn should_sectionalize_impl_methods() { } #[cfg(test)] -pub mod test { +mod test { + #[legacy_exports]; + use astsrv; use attr_pass; use doc; use extract; - use sectionalize_pass::run; - pub fn mk_doc(source: ~str) -> doc::Doc { + fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); let doc = (attr_pass::mk_pass().f)(srv, doc); diff --git a/src/librustdoc/sort_item_name_pass.rs b/src/librustdoc/sort_item_name_pass.rs index 9a777d79345..58349318bbb 100644 --- a/src/librustdoc/sort_item_name_pass.rs +++ b/src/librustdoc/sort_item_name_pass.rs @@ -14,7 +14,6 @@ use astsrv; use doc::ItemUtils; use doc; use extract; -use pass::Pass; use sort_pass; pub fn mk_pass() -> Pass { diff --git a/src/librustdoc/sort_item_type_pass.rs b/src/librustdoc/sort_item_type_pass.rs index 332c2082e4b..4f69a307c20 100644 --- a/src/librustdoc/sort_item_type_pass.rs +++ b/src/librustdoc/sort_item_type_pass.rs @@ -10,13 +10,10 @@ //! Sorts items by type -use core::prelude::*; - use astsrv; use doc::ItemUtils; use doc; use extract; -use pass::Pass; use sort_pass; pub fn mk_pass() -> Pass { diff --git a/src/librustdoc/sort_pass.rs b/src/librustdoc/sort_pass.rs index c6d2ab0e9ad..fcf878dbf8d 100644 --- a/src/librustdoc/sort_pass.rs +++ b/src/librustdoc/sort_pass.rs @@ -10,15 +10,12 @@ //! A general sorting pass -use core::prelude::*; - use astsrv; use doc::ItemUtils; use doc; use extract; use fold::Fold; use fold; -use pass::Pass; use util::NominalOp; use std::sort; diff --git a/src/librustdoc/text_pass.rs b/src/librustdoc/text_pass.rs index 975767727c5..ae205883902 100644 --- a/src/librustdoc/text_pass.rs +++ b/src/librustdoc/text_pass.rs @@ -10,14 +10,11 @@ //! Generic pass for performing an operation on all descriptions -use core::prelude::*; - use astsrv; use doc::ItemUtils; use doc; use fold::Fold; use fold; -use pass::Pass; use util::NominalOp; use std::par; @@ -291,17 +288,18 @@ fn should_execute_on_impl_method_section_bodies() { #[cfg(test)] mod test { + #[legacy_exports]; + use astsrv; use attr_pass; use desc_to_brief_pass; use doc; use extract; use sectionalize_pass; - use text_pass::mk_pass; use core::str; - pub fn mk_doc(source: ~str) -> doc::Doc { + fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); let doc = (attr_pass::mk_pass().f)(srv, doc); diff --git a/src/librustdoc/trim_pass.rs b/src/librustdoc/trim_pass.rs index 4ac8b51a6bc..731a2bb7ad6 100644 --- a/src/librustdoc/trim_pass.rs +++ b/src/librustdoc/trim_pass.rs @@ -17,10 +17,8 @@ is interpreted as the brief description. use doc::ItemUtils; use doc; -use pass::Pass; use text_pass; -use core::option::Some; use core::str; pub fn mk_pass() -> Pass { @@ -37,13 +35,14 @@ fn should_trim_text() { #[cfg(test)] mod test { + #[legacy_exports]; + use astsrv; use attr_pass; use doc; use extract; - use trim_pass::mk_pass; - pub fn mk_doc(source: ~str) -> doc::Doc { + fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); let doc = (attr_pass::mk_pass().f)(srv, doc); diff --git a/src/librustdoc/tystr_pass.rs b/src/librustdoc/tystr_pass.rs index 97d57569c73..92f2e0a5e8b 100644 --- a/src/librustdoc/tystr_pass.rs +++ b/src/librustdoc/tystr_pass.rs @@ -10,8 +10,6 @@ //! Pulls type information out of the AST and attaches it to the document -use core::prelude::*; - use astsrv; use doc::ItemUtils; use doc; @@ -19,7 +17,6 @@ use extract::to_str; use extract; use fold::Fold; use fold; -use pass::Pass; use core::vec; use std::map::HashMap; @@ -35,7 +32,7 @@ pub fn mk_pass() -> Pass { } } -pub fn run( +fn run( srv: astsrv::Srv, +doc: doc::Doc ) -> doc::Doc { @@ -408,13 +405,14 @@ fn should_not_serialize_struct_attrs() { } #[cfg(test)] -pub mod test { +mod test { + #[legacy_exports]; + use astsrv; use doc; use extract; - use tystr_pass::run; - pub fn mk_doc(source: ~str) -> doc::Doc { + fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); run(srv, doc) diff --git a/src/librustdoc/unindent_pass.rs b/src/librustdoc/unindent_pass.rs index 87c249a7a18..e18d1652a5b 100644 --- a/src/librustdoc/unindent_pass.rs +++ b/src/librustdoc/unindent_pass.rs @@ -19,9 +19,6 @@ instances where the string containing the doc comment is opened in the middle of a line, and each of the following lines is indented. */ -use core::prelude::*; - -use pass::Pass; use text_pass; use core::str; diff --git a/src/librustdoc/util.rs b/src/librustdoc/util.rs index 48ed77099c4..998b64421d5 100644 --- a/src/librustdoc/util.rs +++ b/src/librustdoc/util.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use core::oldcomm; use core::task; diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index 3463b31c55c..b38f756a2b5 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -20,7 +20,6 @@ use sync::{Mutex, mutex_with_condvars, RWlock, rwlock_with_condvars}; use core::cast; use core::pipes; -use core::prelude::*; use core::private::{SharedMutableState, shared_mutable_state}; use core::private::{clone_shared_mutable_state, unwrap_shared_mutable_state}; use core::private::{get_shared_mutable_state, get_shared_immutable_state}; @@ -471,9 +470,6 @@ impl<T: Const Owned> &RWReadMode<T> { mod tests { #[legacy_exports]; - use core::prelude::*; - - use arc::*; use arc; use core::oldcomm::*; diff --git a/src/libstd/arena.rs b/src/libstd/arena.rs index 6fee82521e8..e817e6e160f 100644 --- a/src/libstd/arena.rs +++ b/src/libstd/arena.rs @@ -42,7 +42,6 @@ use core::at_vec; use core::cast::reinterpret_cast; use core::cast; use core::libc::size_t; -use core::prelude::*; use core::ptr; use core::sys::TypeDesc; use core::sys; diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index 834edc3f464..38ebe67898d 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -11,7 +11,6 @@ #[forbid(deprecated_mode)]; use core::ops; -use core::prelude::*; use core::uint; use core::vec::{to_mut, from_elem}; use core::vec; @@ -579,9 +578,6 @@ impl Bitv: ops::Index<uint,bool> { mod tests { #[legacy_exports]; - use core::prelude::*; - - use bitv::*; use bitv; use core::uint; diff --git a/src/libstd/c_vec.rs b/src/libstd/c_vec.rs index fe1bfa62fb1..aa9e864adfd 100644 --- a/src/libstd/c_vec.rs +++ b/src/libstd/c_vec.rs @@ -40,7 +40,6 @@ use core::libc; use core::oldcomm; use core::option; -use core::prelude::*; use core::ptr; use core::task; @@ -153,10 +152,6 @@ pub unsafe fn ptr<T>(t: CVec<T>) -> *mut T { #[cfg(test)] mod tests { - use core::prelude::*; - - use c_vec::*; - use core::libc::*; use core::libc; diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index d4077e94617..29c75e629e9 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -11,7 +11,6 @@ #[forbid(deprecated_mode)]; use core::option; -use core::prelude::*; /// A dynamic, mutable location. /// diff --git a/src/libstd/comm.rs b/src/libstd/comm.rs index 3118a0c1ba5..850e53c2d48 100644 --- a/src/libstd/comm.rs +++ b/src/libstd/comm.rs @@ -20,7 +20,6 @@ Higher level communication abstractions. use core::pipes::{GenericChan, GenericSmartChan, GenericPort}; use core::pipes::{Chan, Port, Selectable, Peekable}; use core::pipes; -use core::prelude::*; /// An extension of `pipes::stream` that allows both sending and receiving. pub struct DuplexStream<T: Owned, U: Owned> { @@ -81,8 +80,6 @@ pub fn DuplexStream<T: Owned, U: Owned>() #[cfg(test)] mod test { #[legacy_exports]; - use comm::DuplexStream; - #[test] fn DuplexStream1() { let (left, right) = DuplexStream(); diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index 71d8743a361..e7042ffa89f 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -15,7 +15,6 @@ use core::cmp::Eq; use core::dvec::DVec; use core::dvec; -use core::prelude::*; use core::uint; use core::vec; @@ -132,9 +131,6 @@ pub fn create<T: Copy>() -> Deque<T> { #[cfg(test)] mod tests { - use core::prelude::*; - - use deque::*; use deque; #[test] diff --git a/src/libstd/ebml.rs b/src/libstd/ebml.rs index 5a2fc2298ae..0f49507cea4 100644 --- a/src/libstd/ebml.rs +++ b/src/libstd/ebml.rs @@ -14,7 +14,6 @@ use serialize; use core::io; use core::ops; -use core::prelude::*; use core::str; use core::vec; @@ -34,18 +33,18 @@ struct EbmlState { data_pos: uint, } -pub struct Doc { +struct Doc { data: @~[u8], start: uint, end: uint, } -pub struct TaggedDoc { +struct TaggedDoc { tag: uint, doc: Doc, } -pub enum EbmlEncoderTag { +enum EbmlEncoderTag { EsUint, EsU64, EsU32, EsU16, EsU8, EsInt, EsI64, EsI32, EsI16, EsI8, EsBool, @@ -61,16 +60,11 @@ pub enum EbmlEncoderTag { // -------------------------------------- pub mod reader { - use ebml::{Doc, EbmlEncoderTag, EsBool, EsEnum, EsEnumBody, EsEnumVid}; - use ebml::{EsF32, EsF64, EsFloat, EsI16, EsI32, EsI64, EsI8, EsInt}; - use ebml::{EsLabel, EsOpaque, EsStr, EsU16, EsU32, EsU64, EsU8, EsUint}; - use ebml::{EsVec, EsVecElt, EsVecLen, TaggedDoc}; use serialize; use core::int; use core::io; use core::ops; - use core::prelude::*; use core::str; use core::vec; @@ -404,11 +398,6 @@ pub mod reader { } pub mod writer { - use ebml::{Doc, EbmlEncoderTag, EsBool, EsEnum, EsEnumBody, EsEnumVid}; - use ebml::{EsF32, EsF64, EsFloat, EsI16, EsI32, EsI64, EsI8, EsInt}; - use ebml::{EsLabel, EsOpaque, EsStr, EsU16, EsU32, EsU64, EsU8, EsUint}; - use ebml::{EsVec, EsVecElt, EsVecLen, TaggedDoc}; - use core::io; use core::str; use core::vec; @@ -679,7 +668,6 @@ mod tests { use serialize; use core::io; - use core::option::{None, Option, Some}; #[test] fn test_option_int() { diff --git a/src/libstd/flatpipes.rs b/src/libstd/flatpipes.rs index 07201a1180d..8f239b2a130 100644 --- a/src/libstd/flatpipes.rs +++ b/src/libstd/flatpipes.rs @@ -42,7 +42,6 @@ use core::io; use core::pipes::GenericChan; use core::pipes::GenericPort; use core::pipes; -use core::prelude::*; use core::sys::size_of; use core::uint; use core::vec; @@ -161,15 +160,14 @@ POD are not equivelant. */ pub mod pod { - use flatpipes::flatteners::{PodUnflattener, PodFlattener}; - use flatpipes::bytepipes::{ReaderBytePort, WriterByteChan}; - use flatpipes::bytepipes::{PipeBytePort, PipeByteChan}; - use flatpipes::{FlatPort, FlatChan}; use core::io::{Reader, Writer}; use core::pipes::{Port, Chan}; use core::pipes; - use core::prelude::*; + use flatpipes::flatteners::{PodUnflattener, PodFlattener}; + use flatpipes::bytepipes::{ReaderBytePort, WriterByteChan}; + use flatpipes::bytepipes::{PipeBytePort, PipeByteChan}; + use flatpipes::{FlatPort, FlatChan}; pub type ReaderPort<T: Copy Owned, R> = FlatPort<T, PodUnflattener<T>, ReaderBytePort<R>>; @@ -328,14 +326,12 @@ pub impl<T,F:Flattener<T>,C:ByteChan> FlatChan<T, F, C> { pub mod flatteners { use ebml; - use flatpipes::{ByteChan, BytePort, Flattener, Unflattener}; use flatpipes::util::BufReader; use json; use serialize::{Encoder, Decoder, Encodable, Decodable}; use core::cast; use core::io::{Writer, Reader, BytesWriter, ReaderUtil}; - use core::prelude::*; use core::ptr; use core::sys::size_of; use core::vec; @@ -500,12 +496,9 @@ pub mod flatteners { } pub mod bytepipes { - use flatpipes::{ByteChan, BytePort}; - use core::io::{Writer, Reader, ReaderUtil}; use core::pipes::{Port, Chan}; use core::pipes; - use core::prelude::*; pub struct ReaderBytePort<R: Reader> { reader: R @@ -629,7 +622,6 @@ pub mod bytepipes { mod util { use core::io::{Reader, BytesReader}; use core::io; - use core::prelude::*; pub struct BufReader { buf: ~[u8], @@ -683,7 +675,6 @@ mod util { #[cfg(test)] mod test { - use core::prelude::*; // XXX: json::Decoder doesn't work because of problems related to // its interior pointers @@ -697,7 +688,6 @@ mod test { use flatpipes::pod; use flatpipes::serial; use flatpipes::util::BufReader; - use flatpipes::{BytePort, FlatChan, FlatPort}; use net::ip; use net::tcp::TcpSocketBuf; @@ -705,7 +695,6 @@ mod test { use core::int; use core::io::BytesReader; use core::io; - use core::prelude::*; use core::result; use core::sys; use core::task; @@ -929,10 +918,6 @@ mod test { // Tests that the different backends behave the same when the // binary streaming protocol is broken mod broken_protocol { - use core::prelude::*; - - use flatpipes::{BytePort, FlatPort}; - use flatpipes::flatteners::PodUnflattener; use flatpipes::pod; use flatpipes::util::BufReader; diff --git a/src/libstd/fun_treemap.rs b/src/libstd/fun_treemap.rs index e0d4b95a7e4..6a24e1e5817 100644 --- a/src/libstd/fun_treemap.rs +++ b/src/libstd/fun_treemap.rs @@ -23,7 +23,6 @@ use core::cmp::{Eq, Ord}; use core::option::{Some, None}; -use core::prelude::*; pub type Treemap<K, V> = @TreeNode<K, V>; diff --git a/src/libstd/future.rs b/src/libstd/future.rs index 6a34c29b516..7cbd42f217d 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -26,7 +26,6 @@ use core::cast; use core::either::Either; use core::option; use core::pipes::{recv, oneshot, ChanOne, PortOne, send_one, recv_one}; -use core::prelude::*; use core::task; #[doc = "The future type"] @@ -146,10 +145,6 @@ pub fn spawn<A:Owned>(blk: fn~() -> A) -> Future<A> { #[allow(non_implicitly_copyable_typarams)] pub mod test { - use core::prelude::*; - - use future::*; - use core::pipes::oneshot; use core::task; diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs index 93eb2095c5e..3d9ee0d3d12 100644 --- a/src/libstd/getopts.rs +++ b/src/libstd/getopts.rs @@ -75,7 +75,6 @@ #[forbid(deprecated_mode)]; use core::cmp::Eq; -use core::prelude::*; use core::result::{Err, Ok}; use core::result; use core::option; @@ -84,16 +83,16 @@ use core::str; use core::vec; #[deriving_eq] -pub enum Name { +enum Name { Long(~str), Short(char), } #[deriving_eq] -pub enum HasArg { Yes, No, Maybe, } +enum HasArg { Yes, No, Maybe, } #[deriving_eq] -pub enum Occur { Req, Optional, Multi, } +enum Occur { Req, Optional, Multi, } /// A description of a possible option #[deriving_eq] @@ -454,10 +453,8 @@ enum FailType { * groups of short and long option names, together. */ pub mod groups { - use getopts::{HasArg, Long, Maybe, Multi, No, Occur, Opt, Optional, Req}; - use getopts::{Result, Short, Yes}; + use getopts::Result; - use core::prelude::*; use core::str; use core::vec; @@ -572,7 +569,7 @@ pub mod groups { /* * Parse command line args with the provided long format options */ - pub fn getopts(args: &[~str], opts: &[OptGroup]) -> ::getopts::Result { + pub fn getopts(args: &[~str], opts: &[OptGroup]) -> Result { ::getopts::getopts(args, vec::flat_map(opts, long_to_short)) } @@ -636,11 +633,9 @@ pub mod groups { #[cfg(test)] mod tests { #[legacy_exports]; - use core::prelude::*; - use opt = getopts; use getopts::groups::OptGroup; - use getopts::*; + use getopts::groups; use core::result::{Err, Ok}; use core::result; diff --git a/src/libstd/json.rs b/src/libstd/json.rs index f29e2b5e2ca..44cd4fe4449 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -23,7 +23,6 @@ use core::cmp::{Eq, Ord}; use core::float; use core::io::{WriterUtil, ReaderUtil}; use core::io; -use core::prelude::*; use core::send_map::linear; use core::str; use core::to_str; @@ -1194,10 +1193,6 @@ impl Error: to_str::ToStr { #[cfg(test)] mod tests { - use core::prelude::*; - - use json::*; - use core::result; use core::send_map::linear; diff --git a/src/libstd/list.rs b/src/libstd/list.rs index 2d9c96b28a9..4a7574afd9f 100644 --- a/src/libstd/list.rs +++ b/src/libstd/list.rs @@ -14,7 +14,6 @@ use core::cmp::Eq; use core::option; use core::option::*; -use core::prelude::*; use core::vec; #[deriving_eq] @@ -163,7 +162,6 @@ pub pure fn each<T>(l: @List<T>, f: fn(&T) -> bool) { mod tests { #[legacy_exports]; - use list::*; use list; use core::option; diff --git a/src/libstd/map.rs b/src/libstd/map.rs index c7d59aa18cb..e4f38496f1d 100644 --- a/src/libstd/map.rs +++ b/src/libstd/map.rs @@ -18,7 +18,6 @@ use core::io; use core::ops; use core::to_str::ToStr; use core::mutable::Mut; -use core::prelude::*; use core::send_map::linear::LinearMap; use core::to_bytes::IterBytes; use core::uint; @@ -121,12 +120,11 @@ pub mod util { // FIXME (#2344): package this up and export it as a datatype usable for // external code that doesn't want to pay the cost of a box. pub mod chained { - use map::{Map, util}; + use map::util; use core::io; use core::ops; use core::option; - use core::prelude::*; use core::uint; use core::vec; @@ -617,7 +615,6 @@ impl<K: Eq IterBytes Hash Copy, V: Copy> @Mut<LinearMap<K, V>>: mod tests { use map; - use core::option::None; use core::option; use core::uint; diff --git a/src/libstd/net_ip.rs b/src/libstd/net_ip.rs index fad583a668b..96bd6367e56 100644 --- a/src/libstd/net_ip.rs +++ b/src/libstd/net_ip.rs @@ -13,7 +13,6 @@ use core::libc; use core::oldcomm; -use core::prelude::*; use core::ptr; use core::result; use core::str; @@ -48,7 +47,7 @@ pub enum IpAddr { } /// Human-friendly feedback on why a parse_addr attempt failed -pub type ParseAddrErr = { +type ParseAddrErr = { err_msg: ~str }; @@ -148,12 +147,8 @@ pub fn get_addr(node: &str, iotask: iotask) } pub mod v4 { - use net::ip::{IpAddr, Ipv4, Ipv6, ParseAddrErr}; use uv::ll; - use uv_ip4_addr = uv::ll::ip4_addr; - use uv_ip4_name = uv::ll::ip4_name; - use core::prelude::*; use core::ptr; use core::result; use core::str; @@ -246,11 +241,6 @@ pub mod v4 { } } pub mod v6 { - use net::ip::{IpAddr, Ipv6, ParseAddrErr}; - use uv_ip6_addr = uv::ll::ip6_addr; - use uv_ip6_name = uv::ll::ip6_name; - - use core::prelude::*; use core::result; use core::str; @@ -360,9 +350,6 @@ extern fn get_addr_cb(handle: *uv_getaddrinfo_t, status: libc::c_int, #[cfg(test)] mod test { - use core::prelude::*; - - use net_ip::*; use net_ip::v4; use net_ip::v6; use uv; diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs index 64e779fb996..ca365e2a7d3 100644 --- a/src/libstd/net_tcp.rs +++ b/src/libstd/net_tcp.rs @@ -24,7 +24,6 @@ use core::io; use core::libc::size_t; use core::libc; use core::oldcomm; -use core::prelude::*; use core::ptr; use core::result::{Result}; use core::result; @@ -87,7 +86,7 @@ pub type TcpErrData = { err_msg: ~str }; /// Details returned as part of a `result::err` result from `tcp::listen` -pub enum TcpListenErrData { +enum TcpListenErrData { /** * Some unplanned-for error. The first and second fields correspond * to libuv's `err_name` and `err_msg` fields, respectively. @@ -375,7 +374,7 @@ pub fn read_stop(sock: &TcpSocket, * * `timeout_msecs` - a `uint` value, in msecs, to wait before dropping the * read attempt. Pass `0u` to wait indefinitely */ -pub fn read(sock: &TcpSocket, timeout_msecs: uint) +fn read(sock: &TcpSocket, timeout_msecs: uint) -> result::Result<~[u8],TcpErrData> { let socket_data = ptr::addr_of(&(*(sock.socket_data))); read_common_impl(socket_data, timeout_msecs) @@ -1271,16 +1270,12 @@ type TcpBufferedSocketData = { //#[cfg(test)] mod test { - use net::ip; - use net::tcp::{GenericListenErr, TcpConnectErrData, TcpListenErrData}; - use net::tcp::{TcpSocket, accept, connect, listen, read, socket_buf}; use net; - use uv::iotask::IoTask; + use net::ip; use uv; use core::io; use core::oldcomm; - use core::prelude::*; use core::result; use core::str; use core::task; diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs index cd683dcf8d0..5fc20351793 100644 --- a/src/libstd/net_url.rs +++ b/src/libstd/net_url.rs @@ -19,7 +19,6 @@ use core::dvec::DVec; use core::from_str::FromStr; use core::io::{Reader, ReaderUtil}; use core::io; -use core::prelude::*; use core::send_map::linear::LinearMap; use core::send_map; use core::str; @@ -736,10 +735,6 @@ impl Url: to_bytes::IterBytes { #[cfg(test)] mod tests { #[legacy_exports]; - - use core::prelude::*; - - use net_url::*; use net_url::UserInfo; use core::result; diff --git a/src/libstd/par.rs b/src/libstd/par.rs index 04d88af1100..d88d298ef18 100644 --- a/src/libstd/par.rs +++ b/src/libstd/par.rs @@ -11,7 +11,6 @@ #[forbid(deprecated_mode)]; use core::cast; -use core::prelude::*; use core::ptr; use core::sys; use core::uint; diff --git a/src/libstd/priority_queue.rs b/src/libstd/priority_queue.rs index 4d341d737f6..42818676359 100644 --- a/src/libstd/priority_queue.rs +++ b/src/libstd/priority_queue.rs @@ -2,7 +2,6 @@ //! A priority queue implemented with a binary heap use core::cmp::Ord; -use core::prelude::*; use core::ptr::addr_of; use core::vec; diff --git a/src/libstd/rl.rs b/src/libstd/rl.rs index f0168607adb..f384cceb41b 100644 --- a/src/libstd/rl.rs +++ b/src/libstd/rl.rs @@ -12,7 +12,6 @@ // state without mutexes. use core::libc::{c_char, c_int}; -use core::prelude::*; use core::str; use core::task; diff --git a/src/libstd/rope.rs b/src/libstd/rope.rs index 153f3956884..1513e621fcb 100644 --- a/src/libstd/rope.rs +++ b/src/libstd/rope.rs @@ -38,7 +38,6 @@ use core::cast; use core::char; use core::option; -use core::prelude::*; use core::str; use core::uint; use core::vec; @@ -449,9 +448,7 @@ pub fn loop_leaves(rope: Rope, it: fn(node::Leaf) -> bool) -> bool{ pub mod iterator { pub mod leaf { - use rope::{Rope, node}; - - use core::prelude::*; + use rope::node; pub fn start(rope: Rope) -> node::leaf_iterator::T { match (rope) { @@ -464,9 +461,7 @@ pub mod iterator { } } pub mod char { - use rope::{Rope, node}; - - use core::prelude::*; + use rope::node; pub fn start(rope: Rope) -> node::char_iterator::T { match (rope) { @@ -565,7 +560,6 @@ pub mod node { use core::cast; use core::char; use core::option; - use core::prelude::*; use core::str; use core::uint; use core::vec; @@ -1141,10 +1135,7 @@ pub mod node { } pub mod leaf_iterator { - use rope::node::{Concat, Leaf, Node, height}; - use core::option; - use core::prelude::*; use core::vec; pub type T = { @@ -1184,11 +1175,9 @@ pub mod node { } pub mod char_iterator { - use rope::node::{Leaf, Node}; use rope::node::leaf_iterator; use core::option; - use core::prelude::*; use core::str; pub type T = { @@ -1270,7 +1259,8 @@ pub mod node { #[cfg(test)] mod tests { - use rope::*; + use rope::iterator; + use rope::node; use core::option; use core::str; diff --git a/src/libstd/serialize.rs b/src/libstd/serialize.rs index aa4ed82bbe9..97d5ad18780 100644 --- a/src/libstd/serialize.rs +++ b/src/libstd/serialize.rs @@ -18,7 +18,6 @@ Core encoding and decoding interfaces. #[forbid(non_camel_case_types)]; use core::at_vec; -use core::prelude::*; use core::vec; pub trait Encoder { diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs index dbcb0c6aeec..a6c14516af2 100644 --- a/src/libstd/smallintmap.rs +++ b/src/libstd/smallintmap.rs @@ -21,7 +21,6 @@ use core::dvec::DVec; use core::ops; use core::option::{Some, None}; use core::option; -use core::prelude::*; // FIXME (#2347): Should not be @; there's a bug somewhere in rustc that // requires this to be. @@ -169,8 +168,6 @@ pub fn as_map<V: Copy>(s: SmallIntMap<V>) -> map::Map<uint, V> { #[cfg(test)] mod tests { - use smallintmap::{mk, SmallIntMap}; - use core::option::None; use core::option; diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs index d83568ddd94..505b2526741 100644 --- a/src/libstd/sort.rs +++ b/src/libstd/sort.rs @@ -13,7 +13,6 @@ use core::cmp::{Eq, Ord}; use core::dvec::DVec; -use core::prelude::*; use core::util; use core::vec::{len, push}; use core::vec; @@ -716,10 +715,6 @@ fn copy_vec<T: Copy>(dest: &[mut T], s1: uint, mod test_qsort3 { #[legacy_exports]; - use core::prelude::*; - - use sort::*; - use core::vec; fn check_sort(v1: &[mut int], v2: &[mut int]) { @@ -763,10 +758,6 @@ mod test_qsort3 { mod test_qsort { #[legacy_exports]; - use core::prelude::*; - - use sort::*; - use core::int; use core::vec; @@ -831,10 +822,6 @@ mod test_qsort { mod tests { #[legacy_exports]; - use core::prelude::*; - - use sort::*; - use core::vec; fn check_sort(v1: &[int], v2: &[int]) { @@ -900,10 +887,6 @@ mod tests { #[cfg(test)] mod test_tim_sort { - use core::prelude::*; - - use sort::tim_sort; - use core::rand; use core::vec; @@ -997,10 +980,6 @@ mod test_tim_sort { #[cfg(test)] mod big_tests { - use core::prelude::*; - - use sort::*; - use core::rand; use core::task; use core::uint; diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index a883062c4b9..d957a7ee2ab 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -19,7 +19,6 @@ use core::option; use core::pipes; -use core::prelude::*; use core::private::{Exclusive, exclusive}; use core::ptr; use core::task; @@ -710,10 +709,6 @@ impl &RWlockReadMode { mod tests { #[legacy_exports]; - use core::prelude::*; - - use sync::*; - use core::cast; use core::option; use core::pipes; diff --git a/src/libstd/task_pool.rs b/src/libstd/task_pool.rs index 5ed2195d2d2..68bf2612f9a 100644 --- a/src/libstd/task_pool.rs +++ b/src/libstd/task_pool.rs @@ -14,7 +14,6 @@ use core::io; use core::pipes::{Chan, Port}; use core::pipes; -use core::prelude::*; use core::task::{SchedMode, SingleThreaded}; use core::task; use core::vec; diff --git a/src/libstd/tempfile.rs b/src/libstd/tempfile.rs index bbe1e5c7ccd..afb9290f6cf 100644 --- a/src/libstd/tempfile.rs +++ b/src/libstd/tempfile.rs @@ -13,7 +13,6 @@ #[forbid(deprecated_mode)]; use core::os; -use core::prelude::*; use core::rand; use core::str; diff --git a/src/libstd/test.rs b/src/libstd/test.rs index 8b4c53604bc..176953663eb 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -29,7 +29,6 @@ use core::io; use core::libc::size_t; use core::oldcomm; use core::option; -use core::prelude::*; use core::result; use core::str; use core::task::TaskBuilder; @@ -80,7 +79,7 @@ pub type TestOpts = {filter: Option<~str>, run_ignored: bool, type OptRes = Either<TestOpts, ~str>; // Parses command line arguments into test options -pub fn parse_opts(args: &[~str]) -> OptRes { +fn parse_opts(args: &[~str]) -> OptRes { let args_ = vec::tail(args); let opts = ~[getopts::optflag(~"ignored"), getopts::optopt(~"logfile")]; let matches = @@ -284,9 +283,9 @@ enum TestEvent { type MonitorMsg = (TestDesc, TestResult); -fn run_tests(opts: &TestOpts, - tests: &[TestDesc], +fn run_tests(opts: &TestOpts, tests: &[TestDesc], callback: fn@(e: TestEvent)) { + let mut filtered_tests = filter_tests(opts, tests); callback(TeFiltered(copy filtered_tests)); @@ -341,9 +340,8 @@ fn get_concurrency() -> uint { } #[allow(non_implicitly_copyable_typarams)] -pub fn filter_tests(opts: &TestOpts, - tests: &[TestDesc]) - -> ~[TestDesc] { +fn filter_tests(opts: &TestOpts, + tests: &[TestDesc]) -> ~[TestDesc] { let mut filtered = vec::slice(tests, 0, tests.len()); // Remove tests that don't match the test filter @@ -395,7 +393,7 @@ pub fn filter_tests(opts: &TestOpts, type TestFuture = {test: TestDesc, wait: fn@() -> TestResult}; -pub fn run_test(test: TestDesc, monitor_ch: oldcomm::Chan<MonitorMsg>) { +fn run_test(test: TestDesc, monitor_ch: oldcomm::Chan<MonitorMsg>) { if test.ignore { oldcomm::send(monitor_ch, (copy test, TrIgnored)); return; @@ -427,8 +425,6 @@ fn calc_result(test: &TestDesc, task_succeeded: bool) -> TestResult { mod tests { #[legacy_exports]; - use test::{TrFailed, TrIgnored, TrOk, filter_tests, parse_opts, run_test}; - use core::either; use core::oldcomm; use core::option; diff --git a/src/libstd/time.rs b/src/libstd/time.rs index 575f49c73fb..7c586c3fd4e 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -16,7 +16,6 @@ use core::libc::{c_char, c_int, c_long, size_t, time_t}; use core::i32; use core::io::{Reader, ReaderUtil}; use core::io; -use core::prelude::*; use core::result::{Result, Ok, Err}; use core::str; @@ -858,8 +857,6 @@ priv fn do_strftime(format: &str, tm: &Tm) -> ~str { mod tests { #[legacy_exports]; - use time::*; - use core::float; use core::os; use core::result; diff --git a/src/libstd/timer.rs b/src/libstd/timer.rs index 18c623c2bd8..038486f2b90 100644 --- a/src/libstd/timer.rs +++ b/src/libstd/timer.rs @@ -19,7 +19,6 @@ use uv::iotask::IoTask; use core::either; use core::libc; use core::oldcomm; -use core::prelude::*; use core::ptr; use core; @@ -165,9 +164,6 @@ extern fn delayed_send_close_cb(handle: *uv::ll::uv_timer_t) unsafe { mod test { #[legacy_exports]; - use core::prelude::*; - - use timer::*; use uv; use core::iter; diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs index af3ab4b88eb..caccb763ee9 100644 --- a/src/libstd/treemap.rs +++ b/src/libstd/treemap.rs @@ -18,8 +18,8 @@ #[forbid(deprecated_mode)]; use core::cmp::{Eq, Ord}; -use core::option::{Option, Some, None}; -use core::prelude::*; +use core::option::{Some, None}; +use Option = core::Option; pub type TreeMap<K: Copy Eq Ord, V: Copy> = @mut TreeEdge<K, V>; @@ -107,9 +107,6 @@ pub fn equals<K: Copy Eq Ord, V: Copy Eq>(t1: &const TreeEdge<K, V>, mod tests { #[legacy_exports]; - use treemap::*; - - use core::option::{None, Option, Some}; use core::str; #[test] diff --git a/src/libstd/uv_global_loop.rs b/src/libstd/uv_global_loop.rs index f65c8ce3875..43ed58aa0c1 100644 --- a/src/libstd/uv_global_loop.rs +++ b/src/libstd/uv_global_loop.rs @@ -123,11 +123,8 @@ fn spawn_loop() -> IoTask { #[cfg(test)] mod test { - use core::prelude::*; - use uv::iotask; use uv::ll; - use uv_global_loop::*; use core::iter; use core::libc; diff --git a/src/libstd/uv_iotask.rs b/src/libstd/uv_iotask.rs index 409d73c2539..7853f1cd9f7 100644 --- a/src/libstd/uv_iotask.rs +++ b/src/libstd/uv_iotask.rs @@ -21,7 +21,6 @@ use ll = uv_ll; use core::libc::c_void; use core::libc; use core::oldcomm::{Port, Chan, listen}; -use core::prelude::*; use core::ptr::addr_of; use core::task::TaskBuilder; use core::task; @@ -177,10 +176,7 @@ extern fn tear_down_close_cb(handle: *ll::uv_async_t) unsafe { #[cfg(test)] mod test { - use core::prelude::*; - use uv::ll; - use uv_iotask::*; use core::iter; use core::libc; diff --git a/src/libstd/uv_ll.rs b/src/libstd/uv_ll.rs index 4446e1388e6..46574ced2e5 100644 --- a/src/libstd/uv_ll.rs +++ b/src/libstd/uv_ll.rs @@ -34,7 +34,6 @@ use core::libc::size_t; use core::libc; -use core::prelude::*; use core::ptr::to_unsafe_ptr; use core::ptr; use core::str; @@ -320,9 +319,6 @@ pub type uv_getaddrinfo_t = { }; pub mod uv_ll_struct_stubgen { - use uv_ll::{uv_async_t, uv_connect_t, uv_getaddrinfo_t, uv_tcp_t}; - use uv_ll::{uv_timer_t, uv_write_t}; - use core::ptr; pub fn gen_stub_uv_tcp_t() -> uv_tcp_t { @@ -1044,10 +1040,6 @@ pub unsafe fn addrinfo_as_sockaddr_in6(input: *addrinfo) -> *sockaddr_in6 { #[cfg(test)] pub mod test { - use core::prelude::*; - - use uv_ll::*; - use core::libc; use core::oldcomm; use core::ptr; diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs index c8898ccd9c7..3631556c2ba 100644 --- a/src/libstd/workcache.rs +++ b/src/libstd/workcache.rs @@ -16,7 +16,6 @@ use core::either::{Either, Left, Right}; use core::io; use core::option; use core::pipes::{recv, oneshot, PortOne, send_one}; -use core::prelude::*; use core::result; use core::run; use core::send_map::linear::LinearMap; diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 42e722f8d53..c7c8c77c70f 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -12,10 +12,10 @@ use ast; use codemap::{span, FileName}; +use parse::token; use core::cast; use core::cmp; -use core::option::{None, Option, Some}; use core::ptr; use core::task; use core::to_bytes; @@ -29,8 +29,7 @@ type spanned<T> = {node: T, span: span}; /* can't import macros yet, so this is copied from token.rs. See its comment * there. */ macro_rules! interner_key ( - () => (cast::transmute::<(uint, uint), - &fn(+v: @@::parse::token::ident_interner)>( + () => (cast::transmute::<(uint, uint), &fn(+v: @@token::ident_interner)>( (-3 as uint, 0u))) ) @@ -769,10 +768,10 @@ type capture_clause = @~[capture_item]; #[auto_decode] #[doc="For macro invocations; parsing is delegated to the macro"] enum token_tree { - tt_tok(span, ::parse::token::Token), + tt_tok(span, token::Token), tt_delim(~[token_tree]), // These only make sense for right-hand-sides of MBE macros - tt_seq(span, ~[token_tree], Option<::parse::token::Token>, bool), + tt_seq(span, ~[token_tree], Option<token::Token>, bool), tt_nonterminal(span, ident) } @@ -834,10 +833,10 @@ type matcher = spanned<matcher_>; #[auto_decode] enum matcher_ { // match one token - match_tok(::parse::token::Token), + match_tok(token::Token), // match repetitions of a sequence: body, separator, zero ok?, // lo, hi position-in-match-array used: - match_seq(~[matcher], Option<::parse::token::Token>, bool, uint, uint), + match_seq(~[matcher], Option<token::Token>, bool, uint, uint), // parse a Rust NT: name to bind, name of NT, position in match array: match_nonterminal(ident, ident, uint) } @@ -1150,7 +1149,7 @@ type fn_decl = #[auto_encode] #[auto_decode] -pub enum purity { +enum purity { pure_fn, // declared with "pure fn" unsafe_fn, // declared with "unsafe fn" impure_fn, // declared with "fn" diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index f56f0c545bf..f35d8c4e1c4 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast::*; use ast; use ast_util::{path_to_ident, stmt_id}; diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 3cab2151fde..eaa61b304cd 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -8,13 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast::*; use ast; use ast_util; use codemap::{span, BytePos}; -use parse::token; use visit; use core::cmp; diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 985e0951794..73c14e2d00c 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -10,8 +10,6 @@ // Functions dealing with attributes and meta_items -use core::prelude::*; - use ast; use ast_util::{spanned, dummy_spanned}; use attr; diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 1e4a40405fd..1f26711abb9 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -21,8 +21,6 @@ source code snippets, etc. */ -use core::prelude::*; - use ast_util; use core::cmp; diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 7e9d257a742..ddffa04622f 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use codemap::span; use codemap; diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index 152c49461b8..b8fe00e246c 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -88,14 +88,10 @@ node twice. */ -use core::prelude::*; - -use ast; use ast_util; use attr; use codemap::span; use ext::base::*; -use parse; use core::vec; use std::map; @@ -425,7 +421,7 @@ fn mk_impl( @{ // This is a new-style impl declaration. // XXX: clownshoes - ident: parse::token::special_idents::clownshoes_extensions, + ident: ast::token::special_idents::clownshoes_extensions, attrs: ~[], id: cx.next_id(), node: ast::item_impl(trait_tps, opt_trait, ty, ~[f(ty)]), diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 7b69084a827..dc774805ed3 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast; use ast_util::dummy_sp; use codemap; diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 4a3c8ee2259..d63f14b5774 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast; use codemap; use codemap::span; diff --git a/src/libsyntax/ext/concat_idents.rs b/src/libsyntax/ext/concat_idents.rs index d847cfee053..4f88ffeeb04 100644 --- a/src/libsyntax/ext/concat_idents.rs +++ b/src/libsyntax/ext/concat_idents.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ext::base::*; use ext::base; diff --git a/src/libsyntax/ext/deriving.rs b/src/libsyntax/ext/deriving.rs index 41804b1022a..3cbc8f3834f 100644 --- a/src/libsyntax/ext/deriving.rs +++ b/src/libsyntax/ext/deriving.rs @@ -11,8 +11,6 @@ /// The compiler code necessary to implement the #[deriving_eq] and /// #[deriving_iter_bytes] extensions. -use core::prelude::*; - use ast::{Ty, and, bind_by_ref, binop, deref, enum_def, enum_variant_kind}; use ast::{expr, expr_match, ident, item, item_, item_struct, item_enum}; use ast::{item_impl, m_imm, meta_item, method, named_field, or, pat}; diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 8faeb167191..27565b44c6d 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast::{crate, expr_, expr_mac, mac_invoc_tt}; use ast::{tt_delim, tt_tok, item_mac, stmt_, stmt_mac, stmt_expr, stmt_semi}; use ast; diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index 0eaa983ccad..b8a27096f73 100644 --- a/src/libsyntax/ext/fmt.rs +++ b/src/libsyntax/ext/fmt.rs @@ -16,8 +16,6 @@ * compiler syntax extension plugin interface. */ -use core::prelude::*; - use ast; use codemap::span; use ext::base::*; diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 56ace4aac1b..7a87d909fe6 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -13,15 +13,13 @@ // To start with, it will be use dummy spans, but it might someday do // something smarter. -use core::prelude::*; - use ast::{ident, node_id}; use ast; use ast_util::{ident_to_path, respan, dummy_sp}; use ast_util; use attr; use codemap::span; -use ext::base::{ext_ctxt, mk_ctxt}; +use ext::base::mk_ctxt; use ext::quote::rt::*; use core::vec; @@ -114,11 +112,9 @@ trait ext_ctxt_ast_builder { impl ext_ctxt: ext_ctxt_ast_builder { fn ty_option(ty: @ast::Ty) -> @ast::Ty { - self.ty_path_ast_builder(path_global(~[ - self.ident_of(~"core"), - self.ident_of(~"option"), - self.ident_of(~"Option") - ], dummy_sp()).add_ty(ty)) + self.ty_path_ast_builder(path(~[self.ident_of(~"Option")], + dummy_sp()) + .add_ty(ty)) } fn block_expr(b: ast::blk) -> @ast::expr { @@ -287,37 +283,10 @@ impl ext_ctxt: ext_ctxt_ast_builder { fn item_mod(name: ident, span: span, +items: ~[@ast::item]) -> @ast::item { - // XXX: Total hack: import `core::kinds::Owned` to work around a - // parser bug whereby `fn f<T: ::kinds::Owned>` doesn't parse. - let vi = ast::view_item_import(~[ - @{ - node: ast::view_path_simple( - self.ident_of(~"Owned"), - path( - ~[ - self.ident_of(~"core"), - self.ident_of(~"kinds"), - self.ident_of(~"Owned") - ], - ast_util::dummy_sp() - ), - ast::type_value_ns, - self.next_id() - ), - span: ast_util::dummy_sp() - } - ]); - let vi = @{ - node: vi, - attrs: ~[], - vis: ast::private, - span: ast_util::dummy_sp() - }; - self.item(name, span, ast::item_mod({ - view_items: ~[vi], + view_items: ~[], items: items})) } diff --git a/src/libsyntax/ext/pipes/check.rs b/src/libsyntax/ext/pipes/check.rs index f2ba413dd38..8eecafa8fa4 100644 --- a/src/libsyntax/ext/pipes/check.rs +++ b/src/libsyntax/ext/pipes/check.rs @@ -29,10 +29,7 @@ that. */ -use core::prelude::*; - use ast; -use codemap::span; use ext::base::ext_ctxt; use ext::pipes::proto::{state, protocol, next_state}; use ext::pipes::proto; diff --git a/src/libsyntax/ext/pipes/liveness.rs b/src/libsyntax/ext/pipes/liveness.rs index 01e99594083..76749f6b2db 100644 --- a/src/libsyntax/ext/pipes/liveness.rs +++ b/src/libsyntax/ext/pipes/liveness.rs @@ -37,11 +37,6 @@ updating the states using rule (2) until there are no changes. */ -use core::prelude::*; - -use ext::base::ext_ctxt; -use ext::pipes::protocol; - use core::str; use std::bitv::{Bitv}; diff --git a/src/libsyntax/ext/pipes/mod.rs b/src/libsyntax/ext/pipes/mod.rs index cb17e56e990..67b5c81ad2d 100644 --- a/src/libsyntax/ext/pipes/mod.rs +++ b/src/libsyntax/ext/pipes/mod.rs @@ -53,8 +53,6 @@ use ext::pipes::proto::{visit, protocol}; use parse::lexer::{new_tt_reader, reader}; use parse::parser::Parser; -use core::option::None; - #[legacy_exports] mod ast_builder; #[legacy_exports] diff --git a/src/libsyntax/ext/pipes/parse_proto.rs b/src/libsyntax/ext/pipes/parse_proto.rs index 6a6e895bd40..0f6b9dbda28 100644 --- a/src/libsyntax/ext/pipes/parse_proto.rs +++ b/src/libsyntax/ext/pipes/parse_proto.rs @@ -10,11 +10,10 @@ // Parsing pipes protocols from token trees. -use ext::pipes::pipec::*; use parse::parser; use parse::token; -use core::prelude::*; +use ext::pipes::pipec::*; trait proto_parser { fn parse_proto(id: ~str) -> protocol; diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index e88ddb841be..ef9c086e3f5 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -20,7 +20,6 @@ use parse::*; use util::interner; use core::dvec::DVec; -use core::prelude::*; use core::str; use core::to_str::ToStr; use core::vec; @@ -386,8 +385,7 @@ impl protocol: gen_init { } } - cx.ty_path_ast_builder(path(~[cx.ident_of(~"super"), - cx.ident_of(~"__Buffer")], self.span) + cx.ty_path_ast_builder(path(~[cx.ident_of(~"__Buffer")], self.span) .add_tys(cx.ty_vars_global(params))) } diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs index 9953b4de50d..a2673c481b1 100644 --- a/src/libsyntax/ext/pipes/proto.rs +++ b/src/libsyntax/ext/pipes/proto.rs @@ -8,11 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast; -use codemap::span; -use ext::base::ext_ctxt; use ext::pipes::ast_builder::{path, append_types}; use core::cmp; diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 4aed5b64747..184093715c6 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -18,7 +18,6 @@ use parse::token::*; use parse::token; use parse; -use core::prelude::*; use core::str; /** @@ -34,7 +33,6 @@ use core::str; pub mod rt { use ast; - use ext::base::ext_ctxt; use parse; use print::pprust; diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index 3d012b393bb..47c6ea8876e 100644 --- a/src/libsyntax/ext/source_util.rs +++ b/src/libsyntax/ext/source_util.rs @@ -16,7 +16,6 @@ use ext::build::{mk_base_vec_e, mk_uint, mk_u8, mk_base_str}; use print::pprust; use core::io; -use core::prelude::*; use core::result; use core::str; use core::vec; diff --git a/src/libsyntax/ext/trace_macros.rs b/src/libsyntax/ext/trace_macros.rs index d5031b97718..c202778d0df 100644 --- a/src/libsyntax/ext/trace_macros.rs +++ b/src/libsyntax/ext/trace_macros.rs @@ -8,18 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use ast::tt_delim; use ast; use codemap::span; -use ext::base::ext_ctxt; use ext::base; +use ext::base::ext_ctxt; +use ast::tt_delim; use parse::lexer::{new_tt_reader, reader}; use parse::parser::Parser; -use core::option::None; - fn expand_trace_macros(cx: ext_ctxt, sp: span, - tt: ~[ast::token_tree]) -> base::mac_result { + tt: ~[ast::token_tree]) -> base::mac_result +{ let sess = cx.parse_sess(); let cfg = cx.cfg(); let tt_rdr = new_tt_reader(cx.parse_sess().span_diagnostic, diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 1f1efdfe165..7386b3b67b9 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast::{ident, matcher_, matcher, match_tok, match_nonterminal, match_seq}; use ast::{tt_delim}; use ast; diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index 47489034a0f..c1745fac710 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast; use ast::{token_tree, tt_delim, tt_tok, tt_seq, tt_nonterminal,ident}; use ast_util; diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 7de4e3f1d5f..6d32c73e1f7 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast::*; use ast; use codemap::span; diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index 49197be4bb9..a3fd069afbb 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -8,11 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast; use ast_util::spanned; -use codemap::BytePos; use parse::common::*; //resolve bug? use parse::token; diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 0e101d54ba3..d5365d59041 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -8,10 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast; -use codemap::{BytePos, CharPos, CodeMap, FileMap}; +use codemap::{CodeMap, FileMap, CharPos}; use diagnostic; use parse::lexer::{is_whitespace, get_str_from, reader}; use parse::lexer::{string_reader, bump, is_eof, nextch}; diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs index 1c6022130dc..ca0bbbb7369 100644 --- a/src/libsyntax/parse/common.rs +++ b/src/libsyntax/parse/common.rs @@ -8,16 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast; use ast_util::spanned; -use codemap::BytePos; use parse::lexer::reader; use parse::parser::Parser; use parse::token; -use core::option::{None, Option, Some}; use core::option; use std::map::HashMap; diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 573c36e619b..c51f7e4dad6 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -8,15 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast; use ast_util; use codemap::{span, CodeMap, CharPos, BytePos}; use codemap; use diagnostic::span_handler; use ext::tt::transcribe::{tt_next_token}; -use ext::tt::transcribe::{tt_reader, new_tt_reader, dup_tt_reader}; +use ext::tt::transcribe::{tt_reader, new_tt_reader, dup_tt_reader}; use parse::token; use core::char; diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index b14b60af134..fb5c6250179 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -10,6 +10,8 @@ //! The main parser interface +#[legacy_exports]; + use ast::node_id; use ast; use codemap::{span, CodeMap, FileMap, CharPos, BytePos}; @@ -22,47 +24,70 @@ use parse::token::{ident_interner, mk_ident_interner}; use util::interner; use core::io; -use core::option::{None, Option, Some}; -use core::path::Path; -use core::result::{Err, Ok, Result}; use core::result; +export parser; +export common; +export lexer; +export token; +export comments; +export prec; +export classify; +export attr; +export obsolete; + +export parse_sess; +export new_parse_sess, new_parse_sess_special_handler; +export next_node_id; +export new_parser_from_file, new_parser_etc_from_file; +export new_parser_from_source_str; +export new_parser_from_tts; +export new_sub_parser_from_file; +export parse_crate_from_file, parse_crate_from_crate_file; +export parse_crate_from_source_str; +export parse_expr_from_source_str, parse_item_from_source_str; +export parse_stmt_from_source_str; +export parse_tts_from_source_str; +export parse_from_source_str; + + #[legacy_exports] -pub mod lexer; +mod lexer; #[legacy_exports] -pub mod parser; +mod parser; #[legacy_exports] -pub mod token; +mod token; #[legacy_exports] -pub mod comments; +mod comments; #[legacy_exports] -pub mod attr; +mod attr; #[legacy_exports] /// Common routines shared by parser mods #[legacy_exports] -pub mod common; +mod common; /// Functions dealing with operator precedence #[legacy_exports] -pub mod prec; +mod prec; /// Routines the parser uses to classify AST nodes #[legacy_exports] -pub mod classify; +mod classify; /// Reporting obsolete syntax #[legacy_exports] -pub mod obsolete; +mod obsolete; + -pub type parse_sess = @{ +type parse_sess = @{ cm: @codemap::CodeMap, mut next_id: node_id, span_diagnostic: span_handler, interner: @ident_interner, }; -pub fn new_parse_sess(demitter: Option<emitter>) -> parse_sess { +fn new_parse_sess(demitter: Option<emitter>) -> parse_sess { let cm = @CodeMap::new(); return @{cm: cm, mut next_id: 1, @@ -71,7 +96,7 @@ pub fn new_parse_sess(demitter: Option<emitter>) -> parse_sess { }; } -pub fn new_parse_sess_special_handler(sh: span_handler, cm: @codemap::CodeMap) +fn new_parse_sess_special_handler(sh: span_handler, cm: @codemap::CodeMap) -> parse_sess { return @{cm: cm, mut next_id: 1, @@ -80,17 +105,15 @@ pub fn new_parse_sess_special_handler(sh: span_handler, cm: @codemap::CodeMap) }; } -pub fn parse_crate_from_file(input: &Path, cfg: ast::crate_cfg, +fn parse_crate_from_file(input: &Path, cfg: ast::crate_cfg, sess: parse_sess) -> @ast::crate { let p = new_crate_parser_from_file(sess, cfg, input); let r = p.parse_crate_mod(cfg); return r; } -pub fn parse_crate_from_source_str(name: ~str, - source: @~str, - cfg: ast::crate_cfg, - sess: parse_sess) -> @ast::crate { +fn parse_crate_from_source_str(name: ~str, source: @~str, cfg: ast::crate_cfg, + sess: parse_sess) -> @ast::crate { let p = new_parser_from_source_str(sess, cfg, name, codemap::FssNone, source); let r = p.parse_crate_mod(cfg); @@ -98,10 +121,8 @@ pub fn parse_crate_from_source_str(name: ~str, return r; } -pub fn parse_expr_from_source_str(name: ~str, - source: @~str, - cfg: ast::crate_cfg, - sess: parse_sess) -> @ast::expr { +fn parse_expr_from_source_str(name: ~str, source: @~str, cfg: ast::crate_cfg, + sess: parse_sess) -> @ast::expr { let p = new_parser_from_source_str(sess, cfg, name, codemap::FssNone, source); let r = p.parse_expr(); @@ -109,12 +130,9 @@ pub fn parse_expr_from_source_str(name: ~str, return r; } -pub fn parse_item_from_source_str(name: ~str, - source: @~str, - cfg: ast::crate_cfg, - +attrs: ~[ast::attribute], - sess: parse_sess) - -> Option<@ast::item> { +fn parse_item_from_source_str(name: ~str, source: @~str, cfg: ast::crate_cfg, + +attrs: ~[ast::attribute], + sess: parse_sess) -> Option<@ast::item> { let p = new_parser_from_source_str(sess, cfg, name, codemap::FssNone, source); let r = p.parse_item(attrs); @@ -122,11 +140,9 @@ pub fn parse_item_from_source_str(name: ~str, return r; } -pub fn parse_stmt_from_source_str(name: ~str, - source: @~str, - cfg: ast::crate_cfg, - +attrs: ~[ast::attribute], - sess: parse_sess) -> @ast::stmt { +fn parse_stmt_from_source_str(name: ~str, source: @~str, cfg: ast::crate_cfg, + +attrs: ~[ast::attribute], + sess: parse_sess) -> @ast::stmt { let p = new_parser_from_source_str(sess, cfg, name, codemap::FssNone, source); let r = p.parse_stmt(attrs); @@ -134,10 +150,8 @@ pub fn parse_stmt_from_source_str(name: ~str, return r; } -pub fn parse_tts_from_source_str(name: ~str, - source: @~str, - cfg: ast::crate_cfg, - sess: parse_sess) -> ~[ast::token_tree] { +fn parse_tts_from_source_str(name: ~str, source: @~str, cfg: ast::crate_cfg, + sess: parse_sess) -> ~[ast::token_tree] { let p = new_parser_from_source_str(sess, cfg, name, codemap::FssNone, source); p.quote_depth += 1u; @@ -146,7 +160,7 @@ pub fn parse_tts_from_source_str(name: ~str, return r; } -pub fn parse_from_source_str<T>(f: fn (p: Parser) -> T, +fn parse_from_source_str<T>(f: fn (p: Parser) -> T, name: ~str, ss: codemap::FileSubstr, source: @~str, cfg: ast::crate_cfg, sess: parse_sess) @@ -162,7 +176,7 @@ pub fn parse_from_source_str<T>(f: fn (p: Parser) -> T, move r } -pub fn next_node_id(sess: parse_sess) -> node_id { +fn next_node_id(sess: parse_sess) -> node_id { let rv = sess.next_id; sess.next_id += 1; // ID 0 is reserved for the crate and doesn't actually exist in the AST @@ -170,7 +184,7 @@ pub fn next_node_id(sess: parse_sess) -> node_id { return rv; } -pub fn new_parser_from_source_str(sess: parse_sess, cfg: ast::crate_cfg, +fn new_parser_from_source_str(sess: parse_sess, cfg: ast::crate_cfg, +name: ~str, +ss: codemap::FileSubstr, source: @~str) -> Parser { let filemap = sess.cm.new_filemap_w_substr(name, ss, source); @@ -179,7 +193,7 @@ pub fn new_parser_from_source_str(sess: parse_sess, cfg: ast::crate_cfg, return Parser(sess, cfg, srdr as reader); } -pub fn new_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, +fn new_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, path: &Path) -> Result<Parser, ~str> { match io::read_whole_file_str(path) { result::Ok(move src) => { @@ -197,7 +211,7 @@ pub fn new_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, /// Create a new parser for an entire crate, handling errors as appropriate /// if the file doesn't exist -pub fn new_crate_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, +fn new_crate_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, path: &Path) -> Parser { match new_parser_from_file(sess, cfg, path) { Ok(move parser) => move parser, @@ -209,7 +223,7 @@ pub fn new_crate_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, /// Create a new parser based on a span from an existing parser. Handles /// error messages correctly when the file does not exist. -pub fn new_sub_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, +fn new_sub_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, path: &Path, sp: span) -> Parser { match new_parser_from_file(sess, cfg, path) { Ok(move parser) => move parser, @@ -219,7 +233,7 @@ pub fn new_sub_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, } } -pub fn new_parser_from_tts(sess: parse_sess, cfg: ast::crate_cfg, +fn new_parser_from_tts(sess: parse_sess, cfg: ast::crate_cfg, tts: ~[ast::token_tree]) -> Parser { let trdr = lexer::new_tt_reader(sess.span_diagnostic, sess.interner, None, tts); diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index 15905c090db..6b73cf308a2 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -17,13 +17,10 @@ Obsolete syntax that becomes too hard to parse can be removed. */ -use core::prelude::*; - use ast::{expr, expr_lit, lit_nil}; use ast; use ast_util::{respan}; use codemap::span; -use parse::parser::Parser; use parse::token::Token; use parse::token; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 80fd04f0e10..f32a782622a 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast::{ProtoBox, ProtoUniq, provided, public, pure_fn, purity, re_static}; use ast::{_mod, add, arg, arm, attribute, bind_by_ref, bind_infer}; use ast::{bind_by_value, bind_by_move, bitand, bitor, bitxor, blk}; @@ -35,24 +33,23 @@ use ast::{lit_bool, lit_float, lit_float_unsuffixed, lit_int}; use ast::{lit_int_unsuffixed, lit_nil, lit_str, lit_uint, local, m_const}; use ast::{m_imm, m_mutbl, mac_, mac_invoc_tt, matcher, match_nonterminal}; use ast::{match_seq, match_tok, method, mode, module_ns, mt, mul, mutability}; -use ast::{named_field, neg, node_id, noreturn, not, pat, pat_box, pat_enum}; -use ast::{pat_ident, pat_lit, pat_range, pat_rec, pat_region, pat_struct}; -use ast::{pat_tup, pat_uniq, pat_wild, path, private, Proto, ProtoBare}; -use ast::{ProtoBorrowed, re_self, re_anon, re_named, region, rem, required}; -use ast::{ret_style, return_val, self_ty, shl, shr, stmt, stmt_decl}; -use ast::{stmt_expr, stmt_semi, stmt_mac, struct_def, struct_field}; -use ast::{struct_immutable, struct_mutable, struct_variant_kind, subtract}; -use ast::{sty_box, sty_by_ref, sty_region, sty_static, sty_uniq, sty_value}; -use ast::{token_tree, trait_method, trait_ref, tt_delim, tt_seq, tt_tok}; -use ast::{tt_nonterminal, tuple_variant_kind, Ty, ty_, ty_bot, ty_box}; -use ast::{ty_field, ty_fixed_length_vec, ty_fn, ty_infer, ty_mac, ty_method}; -use ast::{ty_nil, ty_param, ty_param_bound, ty_path, ty_ptr, ty_rec, ty_rptr}; -use ast::{ty_tup, ty_u32, ty_uniq, ty_vec, type_value_ns, uniq}; -use ast::{unnamed_field, unsafe_blk, unsafe_fn, variant, view_item}; -use ast::{view_item_, view_item_export, view_item_import, view_item_use}; -use ast::{view_path, view_path_glob, view_path_list, view_path_simple}; -use ast::{visibility, vstore, vstore_box, vstore_fixed, vstore_slice}; -use ast::{vstore_uniq}; +use ast::{named_field, neg, noreturn, not, pat, pat_box, pat_enum, pat_ident}; +use ast::{pat_lit, pat_range, pat_rec, pat_region, pat_struct, pat_tup}; +use ast::{pat_uniq, pat_wild, path, private, Proto, ProtoBare, ProtoBorrowed}; +use ast::{re_self, re_anon, re_named, region, rem, required, ret_style}; +use ast::{return_val, self_ty, shl, shr, stmt, stmt_decl, stmt_expr}; +use ast::{stmt_semi, stmt_mac, struct_def, struct_field, struct_immutable}; +use ast::{struct_mutable, struct_variant_kind, subtract, sty_box, sty_by_ref}; +use ast::{sty_region, sty_static, sty_uniq, sty_value, token_tree}; +use ast::{trait_method, trait_ref, tt_delim, tt_seq, tt_tok, tt_nonterminal}; +use ast::{tuple_variant_kind, Ty, ty_, ty_bot, ty_box, ty_field, ty_fn}; +use ast::{ty_fixed_length_vec, type_value_ns, uniq, unnamed_field}; +use ast::{ty_infer, ty_mac, ty_method, ty_nil, ty_param, ty_param_bound}; +use ast::{ty_path, ty_ptr, ty_rec, ty_rptr, ty_tup, ty_u32, ty_uniq, ty_vec}; +use ast::{unsafe_blk, unsafe_fn, variant, view_item, view_item_}; +use ast::{view_item_export, view_item_import, view_item_use, view_path}; +use ast::{view_path_glob, view_path_list, view_path_simple, visibility}; +use ast::{vstore, vstore_box, vstore_fixed, vstore_slice, vstore_uniq}; use ast; use ast_util::{spanned, respan, mk_sp, ident_to_path, operator_prec}; use ast_util; @@ -72,7 +69,6 @@ use parse::prec::{as_prec, token_to_binop}; use parse::token::{can_begin_expr, is_ident, is_ident_or_path}; use parse::token::{is_plain_ident, INTERPOLATED, special_idents}; use parse::token; -use parse::{new_sub_parser_from_file, next_node_id, parse_sess}; use print::pprust::expr_to_str; use util::interner::Interner; diff --git a/src/libsyntax/parse/prec.rs b/src/libsyntax/parse/prec.rs index 10754777129..4663b875bb5 100644 --- a/src/libsyntax/parse/prec.rs +++ b/src/libsyntax/parse/prec.rs @@ -12,11 +12,9 @@ export as_prec; export unop_prec; export token_to_binop; -use ast::*; use parse::token::*; use parse::token::Token; - -use core::prelude::*; +use ast::*; /// Unary operators have higher precedence than binary const unop_prec: uint = 100u; diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 606247b8cbe..f286b15c752 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast; use ast_util; use parse::token; diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index b3b267027ce..c9d2abfe0cb 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use core::cmp; use core::dvec::DVec; use core::io::WriterUtil; diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index c121bc30b96..239cff22cc0 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast::{required, provided}; use ast; use ast_util; @@ -18,9 +16,9 @@ use attr; use codemap::{CodeMap, BytePos}; use codemap; use diagnostic; -use parse::classify::{expr_is_simple_block, expr_requires_semi_to_be_stmt}; -use parse::classify::{stmt_ends_with_semi}; +use parse::classify::*; use parse::token::ident_interner; +use parse::token; use parse::{comments, lexer, token}; use parse; use print::pp::{break_offset, word, printer, space, zerobreak, hardbreak}; diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index fd759a32941..cfa3a4224c5 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -11,12 +11,12 @@ // An "interner" is a data structure that associates values with uint tags and // allows bidirectional lookup; i.e. given a value, one can easily find the // type, and vice versa. - -use core::prelude::*; - -use core::dvec::DVec; -use std::map::HashMap; use std::map; +use std::map::HashMap; +use dvec::DVec; +use cmp::Eq; +use hash::Hash; +use to_bytes::IterBytes; type hash_interner<T: Const> = {map: HashMap<T, uint>, diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 3f7ba2dc37b..b7d894a7e9f 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::prelude::*; - use ast::*; use ast; use ast_util; diff --git a/src/test/bench/task-perf-word-count-generic.rs b/src/test/bench/task-perf-word-count-generic.rs index b0be34508b3..e24979a4e06 100644 --- a/src/test/bench/task-perf-word-count-generic.rs +++ b/src/test/bench/task-perf-word-count-generic.rs @@ -45,9 +45,9 @@ trait word_reader { fn read_word() -> Option<~str>; } -// These used to be in task, but they disappeared. -pub type joinable_task = Port<()>; -pub fn spawn_joinable(+f: fn~()) -> joinable_task { +// These used to be in task, but they disappeard. +type joinable_task = Port<()>; +fn spawn_joinable(+f: fn~()) -> joinable_task { let p = Port(); let c = Chan(&p); do task::spawn() |move f| { @@ -57,7 +57,7 @@ pub fn spawn_joinable(+f: fn~()) -> joinable_task { p } -pub fn join(t: joinable_task) { +fn join(t: joinable_task) { t.recv() } @@ -90,11 +90,11 @@ fn reduce(word: &~str, get: map_reduce::getter<int>) { io::println(fmt!("%s\t%?", *word, count)); } -pub struct box<T> { +struct box<T> { mut contents: Option<T>, } -pub impl<T> box<T> { +impl<T> box<T> { fn swap(f: fn(+v: T) -> T) { let mut tmp = None; self.contents <-> tmp; @@ -108,16 +108,13 @@ pub impl<T> box<T> { } } -pub fn box<T>(+x: T) -> box<T> { +fn box<T>(+x: T) -> box<T> { box { contents: Some(move x) } } mod map_reduce { - use core::oldcomm::*; - - use std::map::HashMap; use std::map; pub type putter<K: Owned, V: Owned> = fn(&K, V); @@ -129,7 +126,7 @@ mod map_reduce { pub type reducer<K: Copy Owned, V: Copy Owned> = fn~(&K, getter<V>); enum ctrl_proto<K: Copy Owned, V: Copy Owned> { - find_reducer(K, Chan<Chan<::map_reduce::reduce_proto<V>>>), + find_reducer(K, Chan<Chan<reduce_proto<V>>>), mapper_done } @@ -141,32 +138,26 @@ mod map_reduce { } reducer_response: recv<K: Copy Owned, V: Copy Owned> { - reducer(::core::oldcomm::Chan<::map_reduce::reduce_proto<V>>) - -> open<K, V> + reducer(Chan<reduce_proto<V>>) -> open<K, V> } ) - pub enum reduce_proto<V: Copy Owned> { - emit_val(V), - done, - addref, - release - } + enum reduce_proto<V: Copy Owned> { emit_val(V), done, addref, release } fn start_mappers<K1: Copy Owned, K2: Hash IterBytes Eq Const Copy Owned, V: Copy Owned>( map: &mapper<K1, K2, V>, ctrls: &mut ~[ctrl_proto::server::open<K2, V>], inputs: &~[K1]) - -> ~[::joinable_task] + -> ~[joinable_task] { let mut tasks = ~[]; for inputs.each |i| { let (ctrl, ctrl_server) = ctrl_proto::init(); - let ctrl = ::box(move ctrl); + let ctrl = box(move ctrl); let i = copy *i; let m = copy *map; - tasks.push(::spawn_joinable(|move ctrl, move i| map_task(copy m, &ctrl, i))); + tasks.push(spawn_joinable(|move ctrl, move i| map_task(copy m, &ctrl, i))); ctrls.push(move ctrl_server); } move tasks @@ -174,16 +165,16 @@ mod map_reduce { fn map_task<K1: Copy Owned, K2: Hash IterBytes Eq Const Copy Owned, V: Copy Owned>( map: mapper<K1, K2, V>, - ctrl: &::box<ctrl_proto::client::open<K2, V>>, + ctrl: &box<ctrl_proto::client::open<K2, V>>, input: K1) { // log(error, "map_task " + input); - let intermediates: HashMap<K2, Chan<::map_reduce::reduce_proto<V>>> + let intermediates: HashMap<K2, Chan<reduce_proto<V>>> = map::HashMap(); do map(input) |key: &K2, val| { let mut c = None; - let found: Option<Chan<::map_reduce::reduce_proto<V>>> + let found: Option<Chan<reduce_proto<V>>> = intermediates.find(*key); match found { Some(_c) => { c = Some(_c); } @@ -204,8 +195,7 @@ mod map_reduce { send(c.get(), emit_val(val)); } - fn finish<K: Copy Owned, V: Copy Owned>( - _k: K, v: Chan<::map_reduce::reduce_proto<V>>) + fn finish<K: Copy Owned, V: Copy Owned>(_k: K, v: Chan<reduce_proto<V>>) { send(v, release); } @@ -216,7 +206,7 @@ mod map_reduce { fn reduce_task<K: Copy Owned, V: Copy Owned>( reduce: ~reducer<K, V>, key: K, - out: Chan<Chan<::map_reduce::reduce_proto<V>>>) + out: Chan<Chan<reduce_proto<V>>>) { let p = Port(); @@ -225,7 +215,7 @@ mod map_reduce { let mut ref_count = 0; let mut is_done = false; - fn get<V: Copy Owned>(p: Port<::map_reduce::reduce_proto<V>>, + fn get<V: Copy Owned>(p: Port<reduce_proto<V>>, ref_count: &mut int, is_done: &mut bool) -> Option<V> { while !*is_done || *ref_count > 0 { @@ -284,7 +274,7 @@ mod map_reduce { let p = Port(); let ch = Chan(&p); let r = copy reduce, kk = k; - tasks.push(::spawn_joinable(|move r| + tasks.push(spawn_joinable(|move r| reduce_task(~copy r, kk, ch) )); c = recv(p); @@ -300,7 +290,7 @@ mod map_reduce { for reducers.each_value |v| { send(v, done) } - for tasks.each |t| { ::join(*t); } + for tasks.each |t| { join(*t); } } } diff --git a/src/test/compile-fail/copy-into-closure.rs b/src/test/compile-fail/copy-into-closure.rs index 21d4fa8eab8..bb96db8c41c 100644 --- a/src/test/compile-fail/copy-into-closure.rs +++ b/src/test/compile-fail/copy-into-closure.rs @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn closure2(+x: core::util::NonCopyable) - -> (core::util::NonCopyable, fn@() -> core::util::NonCopyable) { - let f = fn@(copy x) -> core::util::NonCopyable { +fn closure2(+x: util::NonCopyable) -> (util::NonCopyable, + fn@() -> util::NonCopyable) { + let f = fn@(copy x) -> util::NonCopyable { //~^ ERROR copying a noncopyable value //~^^ NOTE non-copyable value cannot be copied into a @fn closure copy x @@ -18,7 +18,7 @@ fn closure2(+x: core::util::NonCopyable) }; (move x,f) } -fn closure3(+x: core::util::NonCopyable) { +fn closure3(+x: util::NonCopyable) { do task::spawn |copy x| { //~^ ERROR copying a noncopyable value //~^^ NOTE non-copyable value cannot be copied into a ~fn closure diff --git a/src/test/compile-fail/issue-2718-a.rs b/src/test/compile-fail/issue-2718-a.rs index 2332d54037f..8acabc6bdc1 100644 --- a/src/test/compile-fail/issue-2718-a.rs +++ b/src/test/compile-fail/issue-2718-a.rs @@ -8,15 +8,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub struct send_packet<T: Copy> { +struct send_packet<T: Copy> { p: T } mod pingpong { - use send_packet; - pub type ping = send_packet<pong>; - pub enum pong = send_packet<ping>; //~ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable + #[legacy_exports]; + type ping = send_packet<pong>; + enum pong = send_packet<ping>; //~ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable } fn main() {} diff --git a/src/test/run-pass/export-non-interference2.rs b/src/test/run-pass/export-non-interference2.rs index 25a4c29244c..464acfba934 100644 --- a/src/test/run-pass/export-non-interference2.rs +++ b/src/test/run-pass/export-non-interference2.rs @@ -9,11 +9,16 @@ // except according to those terms. mod foo { + #[legacy_exports]; + + export bar; + mod bar { - pub fn y() { ::foo::x(); } + #[legacy_exports]; + fn y() { x(); } } - pub fn x() { debug!("x"); } + fn x() { debug!("x"); } } fn main() { foo::bar::y(); } diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index 6232f0c6e06..577ac67dd6a 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -20,20 +20,16 @@ extern mod std; use std::map; use std::map::HashMap; -use core::oldcomm::Chan; -use core::oldcomm::Port; -use core::oldcomm::send; -use core::oldcomm::recv; +use oldcomm::Chan; +use oldcomm::Port; +use oldcomm::send; +use oldcomm::recv; -pub fn map(filename: ~str, emit: map_reduce::putter) { emit(filename, ~"1"); } +fn map(filename: ~str, emit: map_reduce::putter) { emit(filename, ~"1"); } mod map_reduce { use std::map; use std::map::HashMap; - use core::oldcomm::Chan; - use core::oldcomm::Port; - use core::oldcomm::send; - use core::oldcomm::recv; pub type putter = fn@(~str, ~str); @@ -68,7 +64,7 @@ mod map_reduce { } } - ::map(input, |a,b| emit(intermediates, ctrl, a, b) ); + map(input, |a,b| emit(intermediates, ctrl, a, b) ); send(ctrl, mapper_done); } diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 7c35c9e8cf1..dc7d5b99d77 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -250,7 +250,7 @@ pub mod pingpong { pub fn do_ping(-c: ping) -> pong { let (sp, rp) = ::pipes::entangle(); - ::pipes::send(move c, pingpong::ping(move sp)); + ::pipes::send(move c, ping(move sp)); move rp } @@ -259,7 +259,7 @@ pub mod pingpong { if packet.is_none() { fail ~"sender closed the connection" } - (pingpong::liberate_pong(option::unwrap(move packet)), ()) + (liberate_pong(option::unwrap(move packet)), ()) } } @@ -274,12 +274,12 @@ pub mod pingpong { if packet.is_none() { fail ~"sender closed the connection" } - (pingpong::liberate_ping(option::unwrap(move packet)), ()) + (liberate_ping(option::unwrap(move packet)), ()) } pub fn do_pong(-c: pong) -> ping { let (sp, rp) = ::pipes::entangle(); - ::pipes::send(move c, pingpong::pong(move sp)); + ::pipes::send(move c, pong(move sp)); move rp } } diff --git a/src/test/run-pass/pipe-bank-proto.rs b/src/test/run-pass/pipe-bank-proto.rs index 856057e10ae..487db85ad66 100644 --- a/src/test/run-pass/pipe-bank-proto.rs +++ b/src/test/run-pass/pipe-bank-proto.rs @@ -17,14 +17,14 @@ use pipes::try_recv; -pub type username = ~str; -pub type password = ~str; -pub type money = float; -pub type amount = float; +type username = ~str; +type password = ~str; +type money = float; +type amount = float; proto! bank ( login:send { - login(::username, ::password) -> login_response + login(username, password) -> login_response } login_response:recv { @@ -33,12 +33,12 @@ proto! bank ( } connected:send { - deposit(::money) -> connected, - withdrawal(::amount) -> withdrawal_response + deposit(money) -> connected, + withdrawal(amount) -> withdrawal_response } withdrawal_response:recv { - money(::money) -> connected, + money(money) -> connected, insufficient_funds -> connected } ) diff --git a/src/test/run-pass/pipe-pingpong-bounded.rs b/src/test/run-pass/pipe-pingpong-bounded.rs index 774e3544d89..803f7f06b51 100644 --- a/src/test/run-pass/pipe-pingpong-bounded.rs +++ b/src/test/run-pass/pipe-pingpong-bounded.rs @@ -43,7 +43,6 @@ mod pingpong { pub enum ping = server::pong; pub enum pong = client::ping; pub mod client { - use core::pipes::*; use core::ptr; pub fn ping(+pipe: ping) -> pong { @@ -62,7 +61,6 @@ mod pingpong { ::pingpong::packets>; } pub mod server { - use core::pipes::*; use core::ptr; pub type ping = pipes::RecvPacketBuffered<::pingpong::ping, diff --git a/src/test/run-pass/pipe-presentation-examples.rs b/src/test/run-pass/pipe-presentation-examples.rs index 0fe845dd1f9..173325834c0 100644 --- a/src/test/run-pass/pipe-presentation-examples.rs +++ b/src/test/run-pass/pipe-presentation-examples.rs @@ -75,12 +75,12 @@ macro_rules! select ( ) // Types and protocols -pub struct Buffer { +struct Buffer { foo: (), } -pub impl Buffer : Drop { +impl Buffer : Drop { fn finalize(&self) {} } @@ -90,11 +90,11 @@ proto! double_buffer ( } wait_buffer:recv { - give_buffer(::Buffer) -> release + give_buffer(Buffer) -> release } release:send { - release(::Buffer) -> acquire + release(Buffer) -> acquire } ) diff --git a/src/test/run-pass/reflect-visit-data.rs b/src/test/run-pass/reflect-visit-data.rs index 3e66c18d58b..cdc23aef944 100644 --- a/src/test/run-pass/reflect-visit-data.rs +++ b/src/test/run-pass/reflect-visit-data.rs @@ -11,7 +11,6 @@ // xfail-fast #[legacy_modes]; -use core::bool; use intrinsic::{TyDesc, get_tydesc, visit_tydesc, TyVisitor}; use libc::c_void; use vec::UnboxedVecRepr; diff --git a/src/test/run-pass/static-impl.rs b/src/test/run-pass/static-impl.rs index 6987dfab1b5..2003a12ea0c 100644 --- a/src/test/run-pass/static-impl.rs +++ b/src/test/run-pass/static-impl.rs @@ -11,18 +11,20 @@ // xfail-fast #[legacy_modes]; -pub trait plus { +use a::*; + +trait plus { fn plus() -> int; } mod a { - use plus; - pub impl uint: plus { fn plus() -> int { self as int + 20 } } + #[legacy_exports]; + impl uint: plus { fn plus() -> int { self as int + 20 } } } mod b { - use plus; - pub impl ~str: plus { fn plus() -> int { 200 } } + #[legacy_exports]; + impl ~str: plus { fn plus() -> int { 200 } } } trait uint_utils { |
