]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Forbid chained imports and fix the logic for one-level renaming imports
authorPatrick Walton <pcwalton@mimiga.net>
Fri, 1 Mar 2013 18:44:43 +0000 (10:44 -0800)
committerPatrick Walton <pcwalton@mimiga.net>
Sun, 3 Mar 2013 00:49:30 +0000 (16:49 -0800)
92 files changed:
doc/rust.md
doc/tutorial-ffi.md
doc/tutorial-tasks.md
doc/tutorial.md
src/compiletest/compiletest.rc
src/compiletest/errors.rs
src/compiletest/header.rs
src/compiletest/procsrv.rs
src/compiletest/runtest.rs
src/compiletest/util.rs
src/etc/combine-tests.py
src/libcore/core.rc
src/libcore/num/num.rs
src/libcore/task/local_data.rs
src/libfuzzer/fuzzer.rc
src/librust/rust.rc
src/librustc/back/arm.rs
src/librustc/back/link.rs
src/librustc/back/x86.rs
src/librustc/back/x86_64.rs
src/librustc/driver/driver.rs
src/librustc/driver/session.rs
src/librustc/front/intrinsic.rs
src/librustc/front/test.rs
src/librustc/metadata/creader.rs
src/librustc/metadata/decoder.rs
src/librustc/middle/lang_items.rs
src/librustc/middle/resolve.rs
src/librustc/middle/trans/build.rs
src/librustc/middle/ty.rs
src/librustc/middle/typeck/check/vtable.rs
src/librustc/middle/typeck/infer/region_inference.rs
src/librustc/rustc.rc
src/librustdoc/config.rs
src/librustdoc/markdown_writer.rs
src/librustdoc/rustdoc.rc
src/librustpkg/rustpkg.rc
src/librustpkg/util.rs
src/libstd/bigint.rs
src/libstd/flatpipes.rs
src/libstd/semver.rs
src/libstd/std.rc
src/libstd/test.rs
src/libstd/timer.rs
src/libstd/uv_global_loop.rs
src/libstd/workcache.rs
src/libsyntax/ext/fmt.rs
src/libsyntax/parse/parser.rs
src/libsyntax/util/interner.rs
src/test/auxiliary/cci_nested_lib.rs
src/test/auxiliary/trait_inheritance_overloading_xc.rs
src/test/compile-fail/import2.rs
src/test/compile-fail/issue-1697.rs
src/test/compile-fail/issue-2590.rs
src/test/compile-fail/issue-2611-3.rs
src/test/compile-fail/issue-2611-4.rs
src/test/compile-fail/issue-2611-5.rs
src/test/compile-fail/issue-3953.rs
src/test/compile-fail/issue-511.rs
src/test/compile-fail/pattern-tyvar-2.rs
src/test/compile-fail/pattern-tyvar.rs
src/test/compile-fail/regions-glb-free-free.rs
src/test/run-fail/issue-2156.rs
src/test/run-fail/zip-different-lengths.rs
src/test/run-pass/auto-encode.rs
src/test/run-pass/import-in-block.rs
src/test/run-pass/import3.rs
src/test/run-pass/import6.rs
src/test/run-pass/import7.rs
src/test/run-pass/issue-2611.rs
src/test/run-pass/issue-2804.rs
src/test/run-pass/issue-2904.rs
src/test/run-pass/issue-3176.rs
src/test/run-pass/issue-3424.rs
src/test/run-pass/issue-3563-3.rs
src/test/run-pass/issue-3609.rs
src/test/run-pass/new-import-syntax.rs
src/test/run-pass/reflect-visit-data.rs
src/test/run-pass/regions-mock-trans-impls.rs
src/test/run-pass/ret-break-cont-in-block.rs
src/test/run-pass/stat.rs
src/test/run-pass/task-comm-0.rs
src/test/run-pass/trait-inheritance-num.rs
src/test/run-pass/trait-inheritance-num0.rs
src/test/run-pass/trait-inheritance-num1.rs
src/test/run-pass/trait-inheritance-num2.rs
src/test/run-pass/trait-inheritance-num3.rs
src/test/run-pass/trait-inheritance-num5.rs
src/test/run-pass/trait-inheritance-overloading-simple.rs
src/test/run-pass/trait-inheritance-overloading.rs
src/test/run-pass/unique-kinds.rs
src/test/run-pass/zip-same-length.rs

index 80f8b8f49c1a4d8ea4286dad37126d473831e086..b45a6a3dd450d6e5c025cd7d7cb38af178512822 100644 (file)
@@ -1360,7 +1360,7 @@ Functions within foreign modules are declared in the same way as other Rust func
 with the exception that they may not have a body and are instead terminated by a semicolon.
 
 ~~~
-# use libc::{c_char, FILE};
+# use core::libc::{c_char, FILE};
 # #[nolink]
 
 extern mod c {
index b7659376ed65cddbf25bd8cc5dc007e8a456789f..add3718ea7fb39613164e91b859d1ccbbd5303b4 100644 (file)
@@ -14,7 +14,7 @@ should compile and run without any extra effort.
 
 ~~~~ {.xfail-test}
 extern mod std;
-use libc::c_uint;
+use core::libc::c_uint;
 
 extern mod crypto {
     fn SHA1(src: *u8, sz: c_uint, out: *u8) -> *u8;
@@ -217,7 +217,7 @@ microsecond-resolution timer.
 
 ~~~~
 extern mod std;
-use libc::c_ulonglong;
+use core::libc::c_ulonglong;
 
 struct timeval {
     tv_sec: c_ulonglong,
index 22d0ff8bf78a2bd41b5f60b3c59ad871715bf645..52f63be984a312d182001683d528be3f972efea8 100644 (file)
@@ -80,8 +80,8 @@ calling the `spawn` function with a closure argument. `spawn` executes the
 closure in the new task.
 
 ~~~~
-# use io::println;
-use task::spawn;
+# use core::io::println;
+use core::task::spawn;
 
 // Print something profound in a different task using a named function
 fn print_message() { println("I am running in a different task!"); }
@@ -110,8 +110,8 @@ execution. Like any closure, the function passed to `spawn` may capture
 an environment that it carries across tasks.
 
 ~~~
-# use io::println;
-# use task::spawn;
+# use core::io::println;
+# use core::task::spawn;
 # fn generate_task_number() -> int { 0 }
 // Generate some state locally
 let child_task_number = generate_task_number();
@@ -127,8 +127,8 @@ in parallel. Thus, on a multicore machine, running the following code
 should interleave the output in vaguely random order.
 
 ~~~
-# use io::print;
-# use task::spawn;
+# use core::io::print;
+# use core::task::spawn;
 
 for int::range(0, 20) |child_task_number| {
     do spawn {
@@ -156,8 +156,8 @@ endpoint. Consider the following example of calculating two results
 concurrently:
 
 ~~~~
-use task::spawn;
-use comm::{stream, Port, Chan};
+use core::task::spawn;
+use core::comm::{stream, Port, Chan};
 
 let (port, chan): (Port<int>, Chan<int>) = stream();
 
@@ -178,7 +178,7 @@ stream for sending and receiving integers (the left-hand side of the `let`,
 a tuple into its component parts).
 
 ~~~~
-# use comm::{stream, Chan, Port};
+# use core::comm::{stream, Chan, Port};
 let (port, chan): (Port<int>, Chan<int>) = stream();
 ~~~~
 
@@ -187,9 +187,8 @@ which will wait to receive the data on the port. The next statement
 spawns the child task.
 
 ~~~~
-# use task::{spawn};
-# use task::spawn;
-# use comm::{stream, Port, Chan};
+# use core::task::spawn;
+# use core::comm::{stream, Port, Chan};
 # fn some_expensive_computation() -> int { 42 }
 # let (port, chan) = stream();
 do spawn || {
@@ -209,7 +208,7 @@ computation, then waits for the child's result to arrive on the
 port:
 
 ~~~~
-# use comm::{stream, Port, Chan};
+# use core::comm::{stream, Port, Chan};
 # fn some_other_expensive_computation() {}
 # let (port, chan) = stream::<int>();
 # chan.send(0);
@@ -224,8 +223,8 @@ example needed to compute multiple results across a number of tasks? The
 following program is ill-typed:
 
 ~~~ {.xfail-test}
-# use task::{spawn};
-# use comm::{stream, Port, Chan};
+# use core::task::{spawn};
+# use core::comm::{stream, Port, Chan};
 # fn some_expensive_computation() -> int { 42 }
 let (port, chan) = stream();
 
@@ -244,8 +243,8 @@ Instead we can use a `SharedChan`, a type that allows a single
 `Chan` to be shared by multiple senders.
 
 ~~~
-# use task::spawn;
-use comm::{stream, SharedChan};
+# use core::task::spawn;
+use core::comm::{stream, SharedChan};
 
 let (port, chan) = stream();
 let chan = SharedChan(chan);
@@ -277,8 +276,8 @@ illustrate the point. For reference, written with multiple streams, it
 might look like the example below.
 
 ~~~
-# use task::spawn;
-# use comm::{stream, Port, Chan};
+# use core::task::spawn;
+# use core::comm::{stream, Port, Chan};
 
 // Create a vector of ports, one for each child task
 let ports = do vec::from_fn(3) |init_val| {
@@ -309,7 +308,7 @@ All tasks are, by default, _linked_ to each other. That means that the fates
 of all tasks are intertwined: if one fails, so do all the others.
 
 ~~~
-# use task::spawn;
+# use core::task::spawn;
 # fn do_some_work() { loop { task::yield() } }
 # do task::try {
 // Create a child task that fails
@@ -393,8 +392,8 @@ internally, with additional logic to wait for the child task to finish
 before returning. Hence:
 
 ~~~
-# use comm::{stream, Chan, Port};
-# use task::{spawn, try};
+# use core::comm::{stream, Chan, Port};
+# use core::task::{spawn, try};
 # fn sleep_forever() { loop { task::yield() } }
 # do task::try {
 let (receiver, sender): (Port<int>, Chan<int>) = stream();
@@ -489,8 +488,8 @@ response itself is simply the stringified version of the received value,
 Here is the code for the parent task:
 
 ~~~~
+# use core::task::spawn;
 # use std::comm::DuplexStream;
-# use task::spawn;
 # fn stringifier(channel: &DuplexStream<~str, uint>) {
 #     let mut value: uint;
 #     loop {
index d31fbbb0c07a15079bf3141a95b770b52c914767..5dc5ef99916e22746b8f0f04bf4714698c353561 100644 (file)
@@ -1313,7 +1313,7 @@ and [`core::str`]. Here are some examples.
 [`core::str`]: core/str.html
 
 ~~~
-# use io::println;
+# use core::io::println;
 # enum Crayon {
 #     Almond, AntiqueBrass, Apricot,
 #     Aquamarine, Asparagus, AtomicTangerine,
@@ -1368,7 +1368,7 @@ Rust also supports _closures_, functions that can access variables in
 the enclosing scope.
 
 ~~~~
-# use println = io::println;
+# use println = core::io::println;
 fn call_closure_with_ten(b: fn(int)) { b(10); }
 
 let captured_var = 20;
@@ -1525,7 +1525,7 @@ words, it is a function that takes an owned closure that takes no
 arguments.
 
 ~~~~
-use task::spawn;
+use core::task::spawn;
 
 do spawn() || {
     debug!("I'm a task, whatever");
@@ -1537,7 +1537,7 @@ lists back to back. Since that is so unsightly, empty argument lists
 may be omitted from `do` expressions.
 
 ~~~~
-# use task::spawn;
+# use core::task::spawn;
 do spawn {
    debug!("Kablam!");
 }
@@ -1568,8 +1568,8 @@ fn each(v: &[int], op: fn(v: &int) -> bool) {
 And using this function to iterate over a vector:
 
 ~~~~
-# use each = vec::each;
-# use println = io::println;
+# use each = core::vec::each;
+# use println = core::io::println;
 each([2, 4, 8, 5, 16], |n| {
     if *n % 2 != 0 {
         println("found odd number!");
@@ -1585,8 +1585,8 @@ out of the loop, you just write `break`. To skip ahead
 to the next iteration, write `loop`.
 
 ~~~~
-# use each = vec::each;
-# use println = io::println;
+# use each = core::vec::each;
+# use println = core::io::println;
 for each([2, 4, 8, 5, 16]) |n| {
     if *n % 2 != 0 {
         println("found odd number!");
@@ -1601,7 +1601,7 @@ normally allowed in closures, in a block that appears as the body of a
 the enclosing function, not just the loop body.
 
 ~~~~
-# use each = vec::each;
+# use each = core::vec::each;
 fn contains(v: &[int], elt: int) -> bool {
     for each(v) |x| {
         if (*x == elt) { return true; }
@@ -1616,7 +1616,7 @@ In these situations it can be convenient to lean on Rust's
 argument patterns to bind `x` to the actual value, not the pointer.
 
 ~~~~
-# use each = vec::each;
+# use each = core::vec::each;
 # fn contains(v: &[int], elt: int) -> bool {
     for each(v) |&x| {
         if (x == elt) { return true; }
@@ -1758,8 +1758,8 @@ Constructors are one common application for static methods, as in `new` above.
 To call a static method, you have to prefix it with the type name and a double colon:
 
 ~~~~
-# use float::consts::pi;
-# use float::sqrt;
+# use core::float::consts::pi;
+# use core::float::sqrt;
 struct Circle { radius: float }
 impl Circle {
     static fn new(area: float) -> Circle { Circle { radius: sqrt(area / pi) } }
@@ -2030,8 +2030,8 @@ The compiler will use type inference to decide which implementation to call.
 
 ~~~~
 trait Shape { static fn new(area: float) -> Self; }
-# use float::consts::pi;
-# use float::sqrt;
+# use core::float::consts::pi;
+# use core::float::sqrt;
 struct Circle { radius: float }
 struct Square { length: float }
 
@@ -2189,8 +2189,8 @@ Now, we can implement `Circle` on a type only if we also implement `Shape`.
 # trait Shape { fn area(&self) -> float; }
 # trait Circle : Shape { fn radius(&self) -> float; }
 # struct Point { x: float, y: float }
-# use float::consts::pi;
-# use float::sqrt;
+# use core::float::consts::pi;
+# use core::float::sqrt;
 # fn square(x: float) -> float { x * x }
 struct CircleStruct { center: Point, radius: float }
 impl Circle for CircleStruct {
@@ -2224,8 +2224,8 @@ Likewise, supertrait methods may also be called on trait objects.
 ~~~ {.xfail-test}
 # trait Shape { fn area(&self) -> float; }
 # trait Circle : Shape { fn radius(&self) -> float; }
-# use float::consts::pi;
-# use float::sqrt;
+# use core::float::consts::pi;
+# use core::float::sqrt;
 # struct Point { x: float, y: float }
 # struct CircleStruct { center: Point, radius: float }
 # impl Circle for CircleStruct { fn radius(&self) -> float { sqrt(self.area() / pi) } }
index 6748edb9dbdf82daf0de05a5706d85f77d850a25..ae5cb1e6f1139890ef2d6c5cef69778308c74889 100644 (file)
@@ -22,18 +22,18 @@ extern mod std(vers = "0.6");
 
 use core::*;
 
-mod procsrv;
-mod util;
-mod header;
-mod runtest;
-mod common;
-mod errors;
+pub mod procsrv;
+pub mod util;
+pub mod header;
+pub mod runtest;
+pub mod common;
+pub mod errors;
 
 use std::getopts;
 use std::test;
 
 use core::{result, either};
-use result::{Ok, Err};
+use core::result::{Ok, Err};
 
 use common::config;
 use common::mode_run_pass;
index d41a4b7360c78719c01027de186f663df0b9ce82..39b70299ba5bdf0c457b4c1197634100b70db53d 100644 (file)
 use core::prelude::*;
 
 use common::config;
-use io;
-use io::ReaderUtil;
-use str;
+
+use core::io;
+use core::io::ReaderUtil;
+use core::str;
 
 pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
 
index 6db55853f9cedcf2366a41ec9e5d981a9c9ca19c..64d1aae5ff5ef080da74b976fa813a4e12b8ad08 100644 (file)
 
 use common;
 use common::config;
-use io;
-use io::ReaderUtil;
-use os;
-use str;
+
+use core::io::ReaderUtil;
+use core::io;
+use core::os;
+use core::str;
 
 pub struct TestProps {
     // Lines that should be expected, in order, on standard out
index 6c8bd7ea44269151e1d49fc42a5f4f0c1ebf6dab..8d8cdb3c719c521a87f8fedb1175fed368106a9d 100644 (file)
 
 use core::prelude::*;
 
-use io;
-use io::{ReaderUtil, WriterUtil};
-use libc;
-use libc::{c_int, pid_t};
-use os;
-use run;
-use run::spawn_process;
-use pipes;
-use str;
-use task;
-use vec;
+use core::io::{ReaderUtil, WriterUtil};
+use core::io;
+use core::libc::{c_int, pid_t};
+use core::libc;
+use core::os;
+use core::pipes;
+use core::run::spawn_process;
+use core::run;
+use core::str;
+use core::task;
+use core::vec;
 
 #[cfg(target_os = "win32")]
 fn target_env(lib_path: ~str, prog: ~str) -> ~[(~str,~str)] {
index 3213a11cbb51c0e2aeda3c275d2148c808051ee7..b5def15fc509c40a8747f87118c1417d5b014fe7 100644 (file)
 
 use core::prelude::*;
 
-use io;
-use io::WriterUtil;
-use os;
-use str;
-use uint;
-use vec;
-
 use common;
 use common::mode_run_pass;
 use common::mode_run_fail;
 use util;
 use util::logv;
 
+use core::io::WriterUtil;
+use core::io;
+use core::os;
+use core::str;
+use core::uint;
+use core::vec;
+
 pub fn run(config: config, testfile: ~str) {
     if config.verbose {
         // We're going to be dumping a lot of info. Start on a new line.
index e4028549f28a28f2842ff9eaff4c415211e0e13f..ad60e532f3cb0a697d5f495e3afa2781e3d9249a 100644 (file)
 
 use core::prelude::*;
 
-use io;
-use os;
-use os::getenv;
-
 use common;
 use common::config;
 
+use core::io;
+use core::os::getenv;
+use core::os;
+
 pub fn make_new_path(path: ~str) -> ~str {
 
     // Windows just uses PATH as the library search path, so we have to
index 8e1a916e2f19ebd022548b568661948b77bd2c0e..93989f8e4a90136195c489372b72bb229bdb1064 100755 (executable)
@@ -52,7 +52,7 @@ d.write("// AUTO-GENERATED FILE: DO NOT EDIT\n")
 d.write("extern mod std;\n")
 d.write("extern mod run_pass_stage2;\n")
 d.write("use run_pass_stage2::*;\n")
-d.write("use io::WriterUtil;\n");
+d.write("use core::io::WriterUtil;\n");
 d.write("fn main() {\n");
 d.write("    let out = io::stdout();\n");
 i = 0
index c8d2da28255f10b73915cc5542eaafb66cc8b9eb..56a18024ac927924cfe2a678a823e7029b4f34e2 100644 (file)
@@ -235,10 +235,10 @@ pub mod private {
 
 /* For internal use, not exported */
 
-mod unicode;
+pub mod unicode;
 #[path = "num/cmath.rs"]
-mod cmath;
-mod stackwalk;
+pub mod cmath;
+pub mod stackwalk;
 
 
 // A curious inner-module that's not exported that contains the binding
@@ -253,8 +253,9 @@ pub mod core {
 
     pub use cmp;
     pub use condition;
-    pub use option;
     pub use kinds;
+    pub use ops;
+    pub use option;
     pub use sys;
     pub use pipes;
 }
index 7038ba07c0dea791394407dc8f8422c2edbaa5c2..4d97df621da3fd0ad61810462ce0feeff6d6da4c 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 //! An interface for numeric types
-use core::cmp::{Ord, Eq};
+use cmp::{Ord, Eq};
 use ops::{Add, Div, Modulo, Mul, Neg, Sub};
 use option::{None, Option, Some};
 use char;
index ae101faaf0264f4f3cf1cc77e17c0e31aa0eb9e6..185d8caae01fa365b23f196c85e141fa149f39ec 100644 (file)
@@ -27,8 +27,8 @@
 */
 
 use prelude::*;
-use rt;
 use task::local_data_priv::{local_get, local_pop, local_modify, local_set};
+use task::rt;
 use task;
 
 /**
index c16a7cf8d3ebed4ad6bcbf7f39ba4cf5c77f5ac4..3714b6763c649b8785f2dbfaf52d534096bf2618 100644 (file)
@@ -31,8 +31,7 @@ extern mod std(vers = "0.6");
 extern mod syntax(vers = "0.6");
 
 use core::*;
-
-use io::WriterUtil;
+use core::io::WriterUtil;
 
 use syntax::{ast, ast_util, fold, visit, codemap};
 use syntax::parse;
index e60f2bfaa5018f49c38439fbfb493b2c6be2a3e1..37e0f874b40dc9288ec4bab4e3f5bbde17e6e6c7 100644 (file)
@@ -220,7 +220,7 @@ fn usage() {
 
 }
 
-fn main() {
+pub fn main() {
     let args = os::args().tail();
 
     if !args.is_empty() {
index faaddfed1e8ba1d992355d85bcf804797df239d4..95337b4150c29b25c7f269a989a962618c834e76 100644 (file)
@@ -9,8 +9,8 @@
 // except according to those terms.
 
 use back::target_strs;
+use driver::session::sess_os_to_meta_os;
 use driver::session;
-use session::sess_os_to_meta_os;
 use metadata::loader::meta_section_name;
 
 pub fn get_target_strs(target_os: session::os) -> target_strs::t {
index 8db27bd675d6eb13c2aa90b3befb0b325bb58531..446b83af425a7b96f409e2176d2188756f66bb3a 100644 (file)
@@ -11,6 +11,7 @@
 use core::prelude::*;
 
 use back::rpath;
+use driver::session::Session;
 use driver::session;
 use lib::llvm::llvm;
 use lib::llvm::{ModuleRef, mk_pass_manager, mk_target_data, True, False};
@@ -21,8 +22,6 @@
 use metadata::{encoder, cstore};
 use middle::trans::common::CrateContext;
 use middle::ty;
-use session::Session;
-use session;
 use util::ppaux;
 
 use core::char;
@@ -89,10 +88,10 @@ pub fn WriteOutputFile(sess: Session,
 
 pub mod jit {
     use back::link::llvm_err;
+    use driver::session::Session;
     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;
@@ -170,11 +169,11 @@ pub mod write {
     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::Session;
     use driver::session;
     use lib::llvm::llvm;
     use lib::llvm::{False, True, ModuleRef, mk_pass_manager, mk_target_data};
     use lib;
-    use session::Session;
 
     use core::char;
     use core::libc::{c_char, c_int, c_uint};
index a768edcc00bb9ac0e1c61fda9d83283b802d3471..2cc812c3d41056f349729549b900190d5e200ce1 100644 (file)
@@ -10,9 +10,9 @@
 
 
 use back::target_strs;
+use driver::session::sess_os_to_meta_os;
 use driver::session;
 use metadata::loader::meta_section_name;
-use session::sess_os_to_meta_os;
 
 pub fn get_target_strs(target_os: session::os) -> target_strs::t {
     return target_strs::t {
index dc48831375960e6a0c8da9b880ec2fe9647cb5a3..b68073974dcf916f895d929d6dc22af693f24dc8 100644 (file)
@@ -10,9 +10,9 @@
 
 
 use back::target_strs;
+use driver::session::sess_os_to_meta_os;
 use driver::session;
 use metadata::loader::meta_section_name;
-use session::sess_os_to_meta_os;
 
 pub fn get_target_strs(target_os: session::os) -> target_strs::t {
     return target_strs::t {
index 61bb03dd7f902f37d74b0f3390ad79a068278f9f..6e6213d4427dab4d13b54125bcd26a8fbbab5830 100644 (file)
 
 use back::link;
 use back::{arm, x86, x86_64};
+use driver::session::{Aggressive};
+use driver::session::{Session, Session_, OptLevel, No, Less, Default};
+use driver::session;
 use front;
 use lib::llvm::llvm;
 use metadata::{creader, cstore, filesearch};
 use metadata;
 use middle::{trans, freevars, kind, ty, typeck, lint, astencode};
 use middle;
-use session::{Session, Session_, OptLevel, No, Less, Default, Aggressive};
-use session;
 use util::ppaux;
 
 use core::cmp;
index 94dbfb51eb8226d97c57643348c7c32634244825..5da16dd5342081238d9b6215f33a0accf22e8055 100644 (file)
@@ -13,7 +13,7 @@
 use back::link;
 use back::target_strs;
 use back;
-use driver;
+use driver::driver::host_triple;
 use driver::session;
 use metadata::filesearch;
 use metadata;
@@ -293,7 +293,7 @@ pub fn basic_options() -> @options {
         output_type: link::output_type_exe,
         addl_lib_search_paths: ~[],
         maybe_sysroot: None,
-        target_triple: driver::host_triple(),
+        target_triple: host_triple(),
         cfg: ~[],
         binary: ~"rustc",
         test: false,
index 02e964ac3d35940c0c47785274b4c1b2bfdf5160..059cd9723e76aed785c8c82891cde5c19e32ac80 100644 (file)
@@ -11,7 +11,7 @@
 // NB: this file is include_str!'ed into the compiler, re-parsed
 // and injected into each crate the compiler builds. Keep it small.
 
-mod intrinsic {
+pub mod intrinsic {
     pub use intrinsic::rusti::visit_tydesc;
 
     // FIXME (#3727): remove this when the interface has settled and the
index 94b49e9d266e4e1ee71932f2b01f3103f13d082a..c17a861165a3ad4a0b5046a1f824046ae785a60c 100644 (file)
 
 use core::prelude::*;
 
+use driver::session::Session;
 use driver::session;
 use front::config;
-use session::Session;
 
 use core::dvec::DVec;
 use core::option;
 use core::vec;
 use syntax::ast_util::*;
+use syntax::attr::attrs_contains_name;
 use syntax::attr;
 use syntax::codemap::{dummy_sp, span, ExpandedFrom, CallInfo, NameAndSpan};
 use syntax::codemap;
+use syntax::ext::base::{mk_ctxt, ext_ctxt};
 use syntax::fold;
 use syntax::print::pprust;
 use syntax::{ast, ast_util};
-use syntax::attr::attrs_contains_name;
-
-use syntax::ext::base::{mk_ctxt, ext_ctxt};
 
 type node_id_gen = fn@() -> ast::node_id;
 
@@ -286,7 +285,7 @@ fn mk_std(cx: &TestCtxt) -> @ast::view_item {
     let vi = ast::view_item {
         node: vi,
         attrs: ~[],
-        vis: ast::private,
+        vis: ast::public,
         span: dummy_sp()
     };
     return @vi;
index 79dec35e4abb85c85237602ea37bd1d8402e2254..307a58135e1387be557ac580315bce22dba7646b 100644 (file)
@@ -80,7 +80,7 @@ fn dump_crates(+crate_cache: @mut ~[cache_entry]) {
 fn warn_if_multiple_versions(e: @mut Env,
                              diag: span_handler,
                              crate_cache: @mut ~[cache_entry]) {
-    use either::*;
+    use core::either::*;
 
     if crate_cache.len() != 0u {
         let name = loader::crate_name_from_metas(
index cbe2217c9fc9b8d2b556e195a5334ca4ac21bcf6..f660c796fa3b8959bb8beff9c400fb8918f0c545 100644 (file)
@@ -14,9 +14,6 @@
 use core::prelude::*;
 
 use metadata::cstore::crate_metadata;
-use dvec::DVec;
-use hash::{Hash, HashUtil};
-use io::WriterUtil;
 use metadata::common::*;
 use metadata::csearch::{ProvidedTraitMethodInfo, StaticMethodInfo};
 use metadata::csearch;
 use util::ppaux::ty_to_str;
 
 use core::cmp;
+use core::dvec::DVec;
 use core::dvec;
+use core::hash::{Hash, HashUtil};
 use core::int;
+use core::io::WriterUtil;
 use core::io;
 use core::option;
 use core::str;
index d399f0e6886e6f8c2015cabbdb7da1efd05a1c73..c0ce6ee515fabc2372c7bb96667b80de3250ae39 100644 (file)
@@ -34,7 +34,7 @@
 
 use core::ptr;
 use std::oldmap::HashMap;
-use str_eq = str::eq;
+use str_eq = core::str::eq;
 
 pub enum LangItem {
     ConstTraitLangItem,         // 0
index 1c4928fd374542617cc7fa42c0e3c8aa73ab1d45..648b7e49204cddad98adb10ef2fd8f0dc2380bed 100644 (file)
 use syntax::opt_vec;
 use syntax::opt_vec::OptVec;
 
-use managed::ptr_eq;
-use dvec::DVec;
-use option::{Some, get, is_some, is_none};
-use str::{connect, split_str};
-use vec::pop;
-
+use core::dvec::DVec;
+use core::managed::ptr_eq;
+use core::option::{Some, get, is_some, is_none};
+use core::str::{connect, split_str};
+use core::vec::pop;
 use std::list::{Cons, List, Nil};
 use std::oldmap::HashMap;
-use str_eq = str::eq;
+use str_eq = core::str::eq;
 
 // Definition mapping
 pub type DefMap = HashMap<node_id,def>;
@@ -305,6 +304,12 @@ pub enum AllowCapturingSelfFlag {
     DontAllowCapturingSelf,     //< The "self" definition cannot be captured.
 }
 
+#[deriving_eq]
+enum NameSearchType {
+    SearchItemsAndPublicImports,    //< Search items and public imports.
+    SearchItemsAndAllImports,       //< Search items and all imports.
+}
+
 pub enum BareIdentifierPatternResolution {
     FoundStructOrEnumVariant(def),
     FoundConst(def),
@@ -1488,7 +1493,7 @@ fn build_reduced_graph_for_view_item(@mut self,
                         let parent_link = ModuleParentLink
                             (self.get_module_from_parent(new_parent), name);
 
-                        child_name_bindings.define_module(privacy,
+                        child_name_bindings.define_module(Public,
                                                           parent_link,
                                                           Some(def_id),
                                                           NormalModuleKind,
@@ -1948,10 +1953,8 @@ fn resolve_imports(@mut self) {
         }
     }
 
-    /**
-     * Attempts to resolve imports for the given module and all of its
-     * submodules.
-     */
+    /// Attempts to resolve imports for the given module and all of its
+    /// submodules.
     fn resolve_imports_for_module_subtree(@mut self, module_: @mut Module) {
         debug!("(resolving imports for module subtree) resolving %s",
                self.module_to_str(module_));
@@ -1974,19 +1977,19 @@ fn resolve_imports_for_module_subtree(@mut self, module_: @mut Module) {
     }
 
     /// Attempts to resolve imports for the given module only.
-    fn resolve_imports_for_module(@mut self, module_: @mut Module) {
-        if (*module_).all_imports_resolved() {
+    fn resolve_imports_for_module(@mut self, module: @mut Module) {
+        if module.all_imports_resolved() {
             debug!("(resolving imports for module) all imports resolved for \
                    %s",
-                   self.module_to_str(module_));
+                   self.module_to_str(module));
             return;
         }
 
-        let import_count = module_.imports.len();
-        while module_.resolved_import_count < import_count {
-            let import_index = module_.resolved_import_count;
-            let import_directive = module_.imports.get_elt(import_index);
-            match self.resolve_import_for_module(module_, import_directive) {
+        let import_count = module.imports.len();
+        while module.resolved_import_count < import_count {
+            let import_index = module.resolved_import_count;
+            let import_directive = module.imports.get_elt(import_index);
+            match self.resolve_import_for_module(module, import_directive) {
                 Failed => {
                     // We presumably emitted an error. Continue.
                     let idents = import_directive.module_path.get();
@@ -2004,7 +2007,7 @@ fn resolve_imports_for_module(@mut self, module_: @mut Module) {
                 }
             }
 
-            module_.resolved_import_count += 1;
+            module.resolved_import_count += 1;
         }
     }
 
@@ -2037,72 +2040,71 @@ fn import_path_to_str(@mut self,
         }
     }
 
-    /**
-     * Attempts to resolve the given import. The return value indicates
-     * failure if we're certain the name does not exist, indeterminate if we
-     * don't know whether the name exists at the moment due to other
-     * currently-unresolved imports, or success if we know the name exists.
-     * If successful, the resolved bindings are written into the module.
-     */
-    fn resolve_import_for_module(@mut self,
-                                 module_: @mut Module,
+    /// Attempts to resolve the given import. The return value indicates
+    /// failure if we're certain the name does not exist, indeterminate if we
+    /// don't know whether the name exists at the moment due to other
+    /// currently-unresolved imports, or success if we know the name exists.
+    /// If successful, the resolved bindings are written into the module.
+    fn resolve_import_for_module(@mut self, module_: @mut Module,
                                  import_directive: @ImportDirective)
                               -> ResolveResult<()> {
-        let mut resolution_result;
+        let mut resolution_result = Failed;
         let module_path = import_directive.module_path;
 
         debug!("(resolving import for module) resolving import `%s::...` in \
                 `%s`",
-               self.idents_to_str((*module_path).get()),
+               self.idents_to_str(module_path.get()),
                self.module_to_str(module_));
 
-        // One-level renaming imports of the form `import foo = bar;` are
-        // handled specially.
-
-        if (*module_path).len() == 0 {
-            resolution_result =
-                self.resolve_one_level_renaming_import(module_,
-                                                       import_directive);
+        // First, resolve the module path for the directive, if necessary.
+        let containing_module = if module_path.len() == 0 {
+            // Use the crate root.
+            Some(self.graph_root.get_module())
         } else {
-            // First, resolve the module path for the directive, if necessary.
             match self.resolve_module_path_for_import(module_,
                                                       module_path,
                                                       DontUseLexicalScope,
                                                       import_directive.span) {
 
-                Failed => {
-                    resolution_result = Failed;
-                }
+                Failed => None,
                 Indeterminate => {
                     resolution_result = Indeterminate;
+                    None
                 }
-                Success(containing_module) => {
-                    // We found the module that the target is contained
-                    // within. Attempt to resolve the import within it.
-
-                    match *import_directive.subclass {
-                        SingleImport(target, source, AnyNS) => {
-                            resolution_result =
-                                self.resolve_single_import(module_,
-                                                           containing_module,
-                                                           target,
-                                                           source);
-                        }
-                        SingleImport(target, source, TypeNSOnly) => {
-                            resolution_result =
-                                self.resolve_single_module_import
-                                    (module_, containing_module, target,
-                                     source);
-                        }
-                        GlobImport => {
-                            let span = import_directive.span;
-                            let p = import_directive.privacy;
-                            resolution_result =
-                                self.resolve_glob_import(p,
-                                                         module_,
-                                                         containing_module,
-                                                         span);
-                        }
+                Success(containing_module) => Some(containing_module),
+            }
+        };
+
+        match containing_module {
+            None => {}
+            Some(containing_module) => {
+                // We found the module that the target is contained
+                // within. Attempt to resolve the import within it.
+
+                match *import_directive.subclass {
+                    SingleImport(target, source, AnyNS) => {
+                        resolution_result =
+                            self.resolve_single_import(module_,
+                                                       containing_module,
+                                                       target,
+                                                       source);
+                    }
+                    SingleImport(target, source, TypeNSOnly) => {
+                        resolution_result =
+                            self.resolve_single_module_import(
+                                module_,
+                                containing_module,
+                                target,
+                                source);
+                    }
+                    GlobImport => {
+                        let span = import_directive.span;
+                        let privacy = import_directive.privacy;
+                        resolution_result =
+                            self.resolve_glob_import(privacy,
+                                                     module_,
+                                                     containing_module,
+                                                     span);
                     }
                 }
             }
@@ -2575,11 +2577,13 @@ fn resolve_glob_import(@mut self,
         return Success(());
     }
 
+    /// Resolves the given module path from the given root `module_`.
     fn resolve_module_path_from_root(@mut self,
                                      module_: @mut Module,
                                      module_path: @DVec<ident>,
                                      index: uint,
-                                     span: span)
+                                     span: span,
+                                     mut name_search_type: NameSearchType)
                                   -> ResolveResult<@mut Module> {
         let mut search_module = module_;
         let mut index = index;
@@ -2594,7 +2598,7 @@ fn resolve_module_path_from_root(@mut self,
             match self.resolve_name_in_module(search_module,
                                               name,
                                               TypeNS,
-                                              false) {
+                                              name_search_type) {
                 Failed => {
                     self.session.span_err(span, ~"unresolved name");
                     return Failed;
@@ -2639,22 +2643,33 @@ fn resolve_module_path_from_root(@mut self,
             }
 
             index += 1;
+
+            // After the first element of the path, allow searching through
+            // items and imports unconditionally. This allows things like:
+            //
+            // pub mod core {
+            //     pub use vec;
+            // }
+            //
+            // pub mod something_else {
+            //     use core::vec;
+            // }
+
+            name_search_type = SearchItemsAndPublicImports;
         }
 
         return Success(search_module);
     }
 
-    /**
-     * Attempts to resolve the module part of an import directive or path
-     * rooted at the given module.
-     */
+    /// Attempts to resolve the module part of an import directive or path
+    /// rooted at the given module.
     fn resolve_module_path_for_import(@mut self,
                                       module_: @mut Module,
                                       module_path: @DVec<ident>,
                                       use_lexical_scope: UseLexicalScopeFlag,
                                       span: span)
                                    -> ResolveResult<@mut Module> {
-        let module_path_len = (*module_path).len();
+        let module_path_len = module_path.len();
         assert module_path_len > 0;
 
         debug!("(resolving module path for import) processing `%s` rooted at \
@@ -2721,12 +2736,15 @@ fn resolve_module_path_for_import(@mut self,
             }
         }
 
-        return self.resolve_module_path_from_root(search_module,
-                                                  module_path,
-                                                  start_index,
-                                                  span);
+        self.resolve_module_path_from_root(search_module,
+                                           module_path,
+                                           start_index,
+                                           span,
+                                           SearchItemsAndPublicImports)
     }
 
+    /// Invariant: This must only be called during main resolution, not during
+    /// import resolution.
     fn resolve_item_in_lexical_scope(@mut self,
                                      module_: @mut Module,
                                      name: ident,
@@ -2822,7 +2840,7 @@ fn resolve_item_in_lexical_scope(@mut self,
             match self.resolve_name_in_module(search_module,
                                               name,
                                               namespace,
-                                              false) {
+                                              SearchItemsAndAllImports) {
                 Failed => {
                     // Continue up the search chain.
                 }
@@ -2973,16 +2991,14 @@ fn resolve_module_prefix(@mut self,
         return Success(PrefixFound(containing_module, i));
     }
 
-    /**
-     * Attempts to resolve the supplied name in the given module for the
-     * given namespace. If successful, returns the target corresponding to
-     * the name.
-     */
+    /// Attempts to resolve the supplied name in the given module for the
+    /// given namespace. If successful, returns the target corresponding to
+    /// the name.
     fn resolve_name_in_module(@mut self,
                               module_: @mut Module,
                               name: ident,
                               namespace: Namespace,
-                              allow_globs: bool)
+                              +name_search_type: NameSearchType)
                            -> ResolveResult<Target> {
         debug!("(resolving name in module) resolving `%s` in `%s`",
                *self.session.str_of(name),
@@ -3001,35 +3017,42 @@ fn resolve_name_in_module(@mut self,
             }
         }
 
-        // Next, check the module's imports. If the module has a glob and
-        // globs were not allowed, then we bail out; we don't know its imports
-        // yet.
-        if !allow_globs && module_.glob_count > 0 {
-            debug!("(resolving name in module) module has glob; bailing out");
-            return Indeterminate;
+        // Next, check the module's imports if necessary.
+
+        // If this is a search of all imports, we should be done with glob
+        // resolution at this point.
+        if name_search_type == SearchItemsAndAllImports {
+            assert module_.glob_count == 0;
         }
 
-        // Otherwise, we check the list of resolved imports.
+        // Check the list of resolved imports.
         match module_.import_resolutions.find(&name) {
             Some(import_resolution) => {
                 if import_resolution.outstanding_references != 0 {
-                    debug!("(resolving name in module) import unresolved; \
-                            bailing out");
+                    debug!("(resolving name in module) import \
+                            unresolved; bailing out");
                     return Indeterminate;
                 }
 
-                match (*import_resolution).target_for_namespace(namespace) {
+                match import_resolution.target_for_namespace(namespace) {
                     None => {
-                        debug!("(resolving name in module) name found, but \
-                                not in namespace %?",
+                        debug!("(resolving name in module) name found, \
+                                but not in namespace %?",
                                namespace);
                     }
-                    Some(target) => {
+                    Some(target)
+                            if name_search_type ==
+                                SearchItemsAndAllImports ||
+                            import_resolution.privacy == Public => {
                         debug!("(resolving name in module) resolved to \
                                 import");
                         import_resolution.state.used = true;
                         return Success(copy target);
                     }
+                    Some(_) => {
+                        debug!("(resolving name in module) name found, \
+                                but not public");
+                    }
                 }
             }
             None => {
@@ -3043,168 +3066,6 @@ fn resolve_name_in_module(@mut self,
         return Failed;
     }
 
-    /**
-     * Resolves a one-level renaming import of the kind `import foo = bar;`
-     * This needs special handling, as, unlike all of the other imports, it
-     * needs to look in the scope chain for modules and non-modules alike.
-     */
-    fn resolve_one_level_renaming_import(@mut self,
-                                         module_: @mut Module,
-                                         import_directive: @ImportDirective)
-                                      -> ResolveResult<()> {
-        let mut target_name;
-        let mut source_name;
-        let allowable_namespaces;
-        match *import_directive.subclass {
-            SingleImport(target, source, namespaces) => {
-                target_name = target;
-                source_name = source;
-                allowable_namespaces = namespaces;
-            }
-            GlobImport => {
-                fail!(~"found `import *`, which is invalid");
-            }
-        }
-
-        debug!("(resolving one-level naming result) resolving import `%s` = \
-                `%s` in `%s`",
-                *self.session.str_of(target_name),
-                *self.session.str_of(source_name),
-                self.module_to_str(module_));
-
-        // Find the matching items in the lexical scope chain for every
-        // namespace. If any of them come back indeterminate, this entire
-        // import is indeterminate.
-
-        let mut module_result;
-        debug!("(resolving one-level naming result) searching for module");
-        match self.resolve_item_in_lexical_scope(module_,
-                                                 source_name,
-                                                 TypeNS,
-                                                 SearchThroughModules) {
-            Failed => {
-                debug!("(resolving one-level renaming import) didn't find \
-                        module result");
-                module_result = None;
-            }
-            Indeterminate => {
-                debug!("(resolving one-level renaming import) module result \
-                        is indeterminate; bailing");
-                return Indeterminate;
-            }
-            Success(name_bindings) => {
-                debug!("(resolving one-level renaming import) module result \
-                        found");
-                module_result = Some(copy name_bindings);
-            }
-        }
-
-        let mut value_result;
-        let mut type_result;
-        if allowable_namespaces == TypeNSOnly {
-            value_result = None;
-            type_result = None;
-        } else {
-            debug!("(resolving one-level naming result) searching for value");
-            match self.resolve_item_in_lexical_scope(module_,
-                                                     source_name,
-                                                     ValueNS,
-                                                     SearchThroughModules) {
-
-                Failed => {
-                    debug!("(resolving one-level renaming import) didn't \
-                            find value result");
-                    value_result = None;
-                }
-                Indeterminate => {
-                    debug!("(resolving one-level renaming import) value \
-                            result is indeterminate; bailing");
-                    return Indeterminate;
-                }
-                Success(name_bindings) => {
-                    debug!("(resolving one-level renaming import) value \
-                            result found");
-                    value_result = Some(copy name_bindings);
-                }
-            }
-
-            debug!("(resolving one-level naming result) searching for type");
-            match self.resolve_item_in_lexical_scope(module_,
-                                                     source_name,
-                                                     TypeNS,
-                                                     SearchThroughModules) {
-
-                Failed => {
-                    debug!("(resolving one-level renaming import) didn't \
-                            find type result");
-                    type_result = None;
-                }
-                Indeterminate => {
-                    debug!("(resolving one-level renaming import) type \
-                            result is indeterminate; bailing");
-                    return Indeterminate;
-                }
-                Success(name_bindings) => {
-                    debug!("(resolving one-level renaming import) type \
-                            result found");
-                    type_result = Some(copy name_bindings);
-                }
-            }
-        }
-
-        //
-        // NB: This one results in effects that may be somewhat surprising. It
-        // means that this:
-        //
-        // mod A {
-        //     impl foo for ... { ... }
-        //     mod B {
-        //         impl foo for ... { ... }
-        //         import bar = foo;
-        //         ...
-        //     }
-        // }
-        //
-        // results in only A::B::foo being aliased to A::B::bar, not A::foo
-        // *and* A::B::foo being aliased to A::B::bar.
-        //
-
-        // If nothing at all was found, that's an error.
-        if is_none(&module_result) &&
-                is_none(&value_result) &&
-                is_none(&type_result) {
-
-            self.session.span_err(import_directive.span,
-                                  ~"unresolved import");
-            return Failed;
-        }
-
-        // Otherwise, proceed and write in the bindings.
-        match module_.import_resolutions.find(&target_name) {
-            None => {
-                fail!(~"(resolving one-level renaming import) reduced graph \
-                      construction or glob importing should have created the \
-                      import resolution name by now");
-            }
-            Some(import_resolution) => {
-                debug!("(resolving one-level renaming import) writing module \
-                        result %? for `%s` into `%s`",
-                       is_none(&module_result),
-                       *self.session.str_of(target_name),
-                       self.module_to_str(module_));
-
-                import_resolution.value_target = value_result;
-                import_resolution.type_target = type_result;
-
-                assert import_resolution.outstanding_references >= 1;
-                import_resolution.outstanding_references -= 1;
-            }
-        }
-
-        debug!("(resolving one-level renaming import) successfully resolved");
-        return Success(());
-    }
-
     fn report_unresolved_imports(@mut self, module_: @mut Module) {
         let index = module_.resolved_import_count;
         let import_count = module_.imports.len();
@@ -4538,10 +4399,8 @@ fn resolve_bare_identifier_pattern(@mut self, name: ident)
         }
     }
 
-    /**
-     * If `check_ribs` is true, checks the local definitions first; i.e.
-     * doesn't skip straight to the containing module.
-     */
+    /// If `check_ribs` is true, checks the local definitions first; i.e.
+    /// doesn't skip straight to the containing module.
     fn resolve_path(@mut self,
                     path: @path,
                     namespace: Namespace,
@@ -4714,6 +4573,8 @@ fn resolve_module_relative_path(@mut self,
         }
     }
 
+    /// Invariant: This must be called only during main resolution, not during
+    /// import resolution.
     fn resolve_crate_relative_path(@mut self,
                                    path: @path,
                                    +xray: XrayFlag,
@@ -4727,8 +4588,8 @@ fn resolve_crate_relative_path(@mut self,
         match self.resolve_module_path_from_root(root_module,
                                                  module_path_idents,
                                                  0,
-                                                 path.span) {
-
+                                                 path.span,
+                                                 SearchItemsAndAllImports) {
             Failed => {
                 self.session.span_err(path.span,
                                       fmt!("use of undeclared module `::%s`",
index 7ac54518d3748bc277f1ae406376eb68adad8224..8db48e1de605518a051bf5d6c3092978bf26782f 100644 (file)
@@ -8,26 +8,25 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-use codemap::span;
-use lib;
 use lib::llvm::llvm;
 use lib::llvm::{CallConv, TypeKind, AtomicBinOp, AtomicOrdering};
 use lib::llvm::{Opcode, IntPredicate, RealPredicate, True, False};
 use lib::llvm::{ValueRef, TypeRef, BasicBlockRef, BuilderRef, ModuleRef};
-use libc::{c_uint, c_int, c_ulonglong};
+use lib;
 use middle::trans::common::*;
 use middle::trans::machine::llsize_of_real;
 
 use core::prelude::*;
 use core::cast::transmute;
 use core::cast;
+use core::libc::{c_uint, c_int, c_ulonglong};
 use core::libc;
 use core::option::Some;
 use core::ptr;
 use core::str;
 use core::vec;
 use std::oldmap::HashMap;
+use syntax::codemap::span;
 use syntax::codemap;
 
 pub fn terminate(cx: block, _: &str) {
index 3c25f2bfc5952c0ae80139009480a0c0932af0d5..a18bba7f3f267e43e9345641969c66ded0187959 100644 (file)
@@ -10,6 +10,7 @@
 
 use core::prelude::*;
 
+use driver::session::Session;
 use driver::session;
 use metadata::csearch;
 use metadata;
@@ -22,7 +23,6 @@
 use middle::ty;
 use middle::typeck;
 use middle;
-use session::Session;
 use util::ppaux::{note_and_explain_region, bound_region_to_str};
 use util::ppaux::{region_to_str, explain_region, vstore_to_str};
 use util::ppaux::{ty_to_str, tys_to_str};
index 2dbf74e1666b4714b6f1f525f89ff0d33294752e..b2d399ac8da493ee7c007cf2d55f26752e566e73 100644 (file)
 use util::ppaux::tys_to_str;
 use util::ppaux;
 
+use core::result::{Result, Ok, Err};
 use core::result;
 use core::uint;
 use core::vec;
-use result::{Result, Ok, Err};
 use std::oldmap::HashMap;
 use syntax::ast;
 use syntax::ast_util;
index d016a6f790a60764e76e80aa2df75fc16227bd71..1ad89fe6f1e5e68e680eeb80345bcce063fc71da 100644 (file)
@@ -552,13 +552,12 @@ fn<a,b>(&a, &b, &a) fn<x,y>(&x, &y, &y) fn<a>(&a, &a, &a) fn<a,b,c>(&a,&b,&c)
 use core::cell::{Cell, empty_cell};
 use core::cmp;
 use core::dvec::DVec;
+use core::result::{Err, Ok, Result};
 use core::to_bytes;
 use core::uint;
 use core::vec;
-use result::Result;
-use result::{Ok, Err};
-use std::oldmap::HashMap;
 use std::list::{List, Nil, Cons};
+use std::oldmap::HashMap;
 use syntax::codemap::span;
 use syntax::codemap;
 
index 140b52f03aaf5440c816aab3335b4ec28024a347..ed6b84b098ed5f33cbd5390f084fac3141dd81b5 100644 (file)
@@ -134,21 +134,21 @@ pub mod lib {
     pub mod llvm;
 }
 
-use result::{Ok, Err};
-use io::ReaderUtil;
+use driver::driver::{host_triple, optgroups, early_error};
+use driver::driver::{str_input, file_input, build_session_options};
+use driver::driver::{build_session, build_configuration, parse_pretty};
+use driver::driver::{pp_mode, pretty_print_input, list_metadata};
+use driver::driver::{compile_input};
+use driver::session;
+use middle::lint;
+
+use core::io::ReaderUtil;
+use core::result::{Ok, Err};
+use std::getopts::{groups, opt_present};
 use std::getopts;
 use std::oldmap::HashMap;
-use getopts::{opt_present};
-use getopts::groups;
 use syntax::codemap;
 use syntax::diagnostic;
-use driver::driver::{host_triple, optgroups, early_error,
-                     str_input, file_input, build_session_options,
-                     build_session, build_configuration, parse_pretty,
-                     pp_mode, pretty_print_input, list_metadata,
-                     compile_input};
-use driver::session;
-use middle::lint;
 
 pub fn version(argv0: &str) {
     let mut vers = ~"unknown version";
index 0add79266302794cf2b79e2593bf6330e9c1939a..50c7b94078bbde58a3ef32d2a7aaf5987e58bc58 100644 (file)
@@ -85,7 +85,7 @@ fn opts() -> ~[(getopts::Opt, ~str)] {
 }
 
 pub fn usage() {
-    use io::println;
+    use core::io::println;
 
     println(~"Usage: rustdoc [options] <cratefile>\n");
     println(~"Options:\n");
index 45a8aa9fd2920c112e3c9fee0b5e0fd806d656fe..b57d8416aaba6ce635ddaed16a8676d0db08a899 100644 (file)
@@ -108,7 +108,7 @@ fn pandoc_writer(
     ];
 
     do generic_writer |markdown| {
-        use io::WriterUtil;
+        use core::io::WriterUtil;
 
         debug!("pandoc cmd: %s", pandoc_cmd);
         debug!("pandoc args: %s", str::connect(pandoc_args, ~" "));
@@ -281,7 +281,7 @@ pub fn mk_doc(name: ~str, source: ~str) -> doc::Doc {
 }
 
 fn write_file(path: &Path, s: ~str) {
-    use io::WriterUtil;
+    use core::io::WriterUtil;
 
     match io::file_writer(path, ~[io::Create, io::Truncate]) {
       result::Ok(writer) => {
index fc0ea4ce396089e7ac096489876d522f16df96f8..54f1a779bcc65b6ecc26ebeb22e869082d44a6b0 100644 (file)
@@ -31,41 +31,41 @@ extern mod syntax(vers = "0.6");
 use core::*;
 use std::par;
 
-mod pass;
-mod config;
-mod parse;
-mod extract;
-mod attr_parser;
-mod doc;
-mod markdown_index_pass;
-mod markdown_pass;
-mod markdown_writer;
-mod fold;
-mod path_pass;
-mod attr_pass;
-mod tystr_pass;
-mod prune_hidden_pass;
-mod desc_to_brief_pass;
-mod text_pass;
-mod unindent_pass;
-mod trim_pass;
-mod astsrv;
-mod demo;
-mod sort_pass;
-mod sort_item_name_pass;
-mod sort_item_type_pass;
-mod page_pass;
-mod sectionalize_pass;
-mod escape_pass;
-mod prune_private_pass;
-mod util;
+pub mod pass;
+pub mod config;
+pub mod parse;
+pub mod extract;
+pub mod attr_parser;
+pub mod doc;
+pub mod markdown_index_pass;
+pub mod markdown_pass;
+pub mod markdown_writer;
+pub mod fold;
+pub mod path_pass;
+pub mod attr_pass;
+pub mod tystr_pass;
+pub mod prune_hidden_pass;
+pub mod desc_to_brief_pass;
+pub mod text_pass;
+pub mod unindent_pass;
+pub mod trim_pass;
+pub mod astsrv;
+pub mod demo;
+pub mod sort_pass;
+pub mod sort_item_name_pass;
+pub mod sort_item_type_pass;
+pub mod page_pass;
+pub mod sectionalize_pass;
+pub mod escape_pass;
+pub mod prune_private_pass;
+pub mod util;
 
 use doc::ItemUtils;
 use doc::Item;
 use pass::Pass;
 use config::Config;
 
-fn main() {
+pub fn main() {
     let args = os::args();
 
     if args.contains(&~"-h") || args.contains(&~"--help") {
@@ -144,7 +144,7 @@ fn run(config: Config) {
     }
 }
 
-fn time<T>(what: ~str, f: fn() -> T) -> T {
+pub fn time<T>(what: ~str, f: fn() -> T) -> T {
     let start = std::time::precise_time_s();
     let rv = f();
     let end = std::time::precise_time_s();
index b58b5977f97ed541a68483762df37cd5b09f1ae7..cc04585153940481027fa8133d04527b7bc666c8 100644 (file)
@@ -27,14 +27,14 @@ extern mod rustc(vers = "0.6");
 extern mod syntax(vers = "0.6");
 
 use core::*;
-use io::{ReaderUtil, WriterUtil};
-use std::{json, semver, getopts};
-use std::net::url;
-use hashmap::linear::LinearMap;
-use rustc::metadata::filesearch;
+use core::hashmap::linear::LinearMap;
+use core::io::{ReaderUtil, WriterUtil};
 use rustc::driver::{driver, session};
-use syntax::{ast, attr, codemap, diagnostic, parse, visit};
+use rustc::metadata::filesearch;
+use std::net::url;
+use std::{json, semver, getopts};
 use syntax::codemap::spanned;
+use syntax::{ast, attr, codemap, diagnostic, parse, visit};
 
 mod usage;
 mod util;
index fdabe86359a6b01d6e11ffb0445c9bf9b87790e7..bd2dd102e45ce384c5509213f4d355c5eafa2038 100644 (file)
@@ -8,20 +8,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use Listener;
+
 use core::*;
-use hashmap::linear::LinearMap;
-use rustc::metadata::filesearch;
+use core::hashmap::linear::LinearMap;
 use rustc::driver::{driver, session};
-use syntax::ast_util::*;
-use syntax::{ast, attr, codemap, diagnostic, fold, parse, visit};
-use codemap::{span, dummy_sp, spanned};
+use rustc::metadata::filesearch;
+use std::getopts::groups::getopts;
 use std::semver;
 use std::{json, term, sort, getopts};
-use getopts::groups::getopts;
-use Listener;
-
+use syntax::ast_util::*;
+use syntax::codemap::{span, dummy_sp, spanned};
 use syntax::ext::base::{mk_ctxt, ext_ctxt};
 use syntax::ext::build;
+use syntax::{ast, attr, codemap, diagnostic, fold, parse, visit};
 
 pub struct Package {
     id: ~str,
index 23a4769775c007f580456c37e0e8e90eb8e5d789..5212a17f373745d565ed141ba1bbfa2d2c9b6ea7 100644 (file)
@@ -865,7 +865,7 @@ pub impl BigInt {
 mod biguint_tests {
 
     use core::*;
-    use num::{IntConvertible, Zero, One};
+    use core::num::{IntConvertible, Zero, One};
     use super::{BigInt, BigUint, BigDigit};
 
     #[test]
index 73dbe4bea5742e374331e0d20dac1396fd3f1814..42f954f7c390d08e9a3ea570ee6a49ea251b4682 100644 (file)
@@ -771,10 +771,10 @@ fn test_some_tcp_stream<U:Unflattener<int>,F:Flattener<int>>(
         writer_chan: WriterChanFactory<F>,
         port: uint) {
 
-        use net::tcp;
+        use core::cell::Cell;
         use net::ip;
-        use cell::Cell;
         use net::tcp::TcpSocket;
+        use net::tcp;
         use uv;
 
         // Indicate to the client task that the server is listening
index 5f96687127cad66d7baa8fd6ef0683cc534a67b5..7c7f3390f2e93f56c929ca76eed971a0aa70537d 100644 (file)
 
 //! Semver parsing and logic
 
-use io;
-use io::{ReaderUtil};
-use option::{Option, Some, None};
-use uint;
-use str;
-use to_str::ToStr;
-use char;
+use core::char;
 use core::cmp;
+use core::io::{ReaderUtil};
+use core::io;
+use core::option::{Option, Some, None};
+use core::str;
+use core::to_str::ToStr;
+use core::uint;
 
 #[deriving_eq]
 pub enum Identifier {
index 2f6c4e3f1904b5337928d3320140400a844ec303..f29872bf3871243a6ff4e5897a6af79463232ca0 100644 (file)
@@ -113,7 +113,7 @@ pub mod serialize;
 // 'std' so that macro-expanded references to std::serialize and such
 // can be resolved within libcore.
 #[doc(hidden)] // FIXME #3538
-mod std {
+pub mod std {
     pub use serialize;
     pub use test;
 }
index 49a8dff4a962db4d101d1e18f5180e0ddae8b8c8..3ebebe59d946b7177d62d6a03b9f88cee0cb9cf8 100644 (file)
@@ -594,15 +594,14 @@ fn calc_result(desc: &TestDesc, task_succeeded: bool) -> TestResult {
 }
 
 pub mod bench {
-
-    use rand;
-    use u64;
-    use vec;
     use time::precise_time_ns;
     use test::{BenchHarness, BenchSamples};
     use stats::Stats;
-    use num;
-    use rand;
+
+    use core::num;
+    use core::rand;
+    use core::u64;
+    use core::vec;
 
     pub impl BenchHarness {
 
index b711825aecf79d61632894df231184b20edab513..7bd411315b225154095fb50686a4d68b69c53289 100644 (file)
@@ -221,7 +221,7 @@ pub fn test_gl_timer_sleep_stress2() {
                 let ch = ch.clone();
                 let hl_loop_clone = hl_loop.clone();
                 do task::spawn {
-                    use rand::*;
+                    use core::rand::*;
                     let rng = Rng();
                     for iter::repeat(times) {
                         sleep(&hl_loop_clone, rng.next() as uint % maxms);
index 52cfc078bace2c2b33515f22ddb07f1bf55f469a..1898ef77320b9ce13ca48522298b9aa7eae180e5 100644 (file)
 
 use ll = uv_ll;
 use iotask = uv_iotask;
-use get_gl = get;
+use get_gl = self::get;
 use uv_iotask::{IoTask, spawn_iotask};
 
+use core::clone::Clone;
+use core::comm::{Port, Chan, SharedChan, select2i};
 use core::either::{Left, Right};
 use core::libc;
-use core::comm::{Port, Chan, SharedChan, select2i};
-use core::unstable::global::{global_data_clone_create,
-                            global_data_clone};
-use core::unstable::weak_task::weaken_task;
+use core::option::{Some, None};
 use core::str;
 use core::task::{task, SingleThreaded, spawn};
 use core::task;
+use core::unstable::global::{global_data_clone_create, global_data_clone};
+use core::unstable::weak_task::weaken_task;
 use core::vec;
-use core::clone::Clone;
-use core::option::{Some, None};
 
 /**
  * Race-free helper to get access to a global task where a libuv
@@ -123,7 +122,7 @@ fn spawn_loop() -> IoTask {
 mod test {
     use core::prelude::*;
 
-    use get_gl = get;
+    use get_gl = uv_global_loop::get;
     use uv::iotask;
     use uv::ll;
     use uv_global_loop::*;
index 592ac40e0824f3c7eb6bc2edd8e879d3ef7b8af7..7f47db3750419ee295a04c74c813db8c7b1712f4 100644 (file)
@@ -396,7 +396,7 @@ fn unwrap<T:Owned + Encodable<json::Encoder> + Decodable<json::Decoder>>(
 
 //#[test]
 fn test() {
-    use io::WriterUtil;
+    use core::io::WriterUtil;
 
     let db = @Mut(Database { db_filename: Path("db.json"),
                              db_cache: LinearMap::new(),
index e06e43f6287cecb903c778954c4862f18ec04b61..c414f7a0b9cbc97139082775a769ea67de1637f0 100644 (file)
@@ -24,7 +24,8 @@
 use ext::base;
 use ext::build;
 use ext::build::*;
-use unstable::extfmt::ct::*;
+
+use core::unstable::extfmt::ct::*;
 
 pub fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
index 4c48b49b5d61eab3e8a800d0f5d7687854b0a874..b4a74d52fb6f3f381d5fecf220256c7aefd977b8 100644 (file)
 use ast;
 use ast_util::{ident_to_path, operator_prec};
 use ast_util;
-use classify;
 use codemap::{span,FssNone, BytePos, spanned, respan, mk_sp};
 use codemap;
 use parse::attr::parser_attr;
+use parse::classify;
 use parse::common::{seq_sep_none, token_to_str};
 use parse::common::{seq_sep_trailing_disallowed, seq_sep_trailing_allowed};
 use parse::lexer::reader;
index 41500d6a409a8c2fdc6a241818b8c838914c17e2..5fc93412c50168436e926c804cce543562faa2c8 100644 (file)
@@ -13,9 +13,8 @@
 // type, and vice versa.
 
 use core::prelude::*;
-
-use hashmap::linear::LinearMap;
-use dvec::DVec;
+use core::dvec::DVec;
+use core::hashmap::linear::LinearMap;
 
 pub struct Interner<T> {
     priv map: @mut LinearMap<T, uint>,
index 1be18459e407c5ba4be64ba5fe2c089a40f5b417..05244ad096a3b629ea6002e64a6cec05fda0d986 100644 (file)
@@ -10,7 +10,7 @@
 
 #[legacy_modes];
 
-use dvec::DVec;
+use core::dvec::DVec;
 
 pub struct Entry<A,B> {key: A, value: B}
 
index 67da2541ca212af8bc9f7553dfa6524032d3d541..10a7238a3f7d01ac49da70f3938fbba786307d95 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use cmp::Eq;
+use core::cmp::Eq;
 
 pub trait MyNum : Add<Self,Self> Sub<Self,Self> Mul<Self,Self> Eq {
 }
index c04bce49d4ade1fe78469f890de6d8dc3ac3e756..5ee4a01f2b9c54ad87e840971472eb4299d63b9d 100644 (file)
@@ -8,8 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern: unresolved
-use baz::zed::bar;
+use baz::zed::bar;  //~ ERROR unresolved name
+//~^ ERROR failed to resolve import
+
 mod baz {}
 mod zed {
     pub fn bar() { debug!("bar3"); }
index 2a64666d94ca671a0b4bcb796353a462744f9d54..a0d2536d85f0e7d2b22e04fa75ae7a855cd0e138 100644 (file)
@@ -10,7 +10,8 @@
 
 // Testing that we don't fail abnormally after hitting the errors
 
-use unresolved::*; //~ ERROR unresolved import
+use unresolved::*; //~ ERROR unresolved name
+//~^ ERROR failed to resolve import
 
 fn main() {
 }
index 22ae941350b4cc8a0626151620634bcfa5f555fb..1de311f4de5482e02615a7cb846944f5ab88f58d 100644 (file)
@@ -8,11 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use dvec::DVec;
+use core::dvec::DVec;
 
-type parser = {
+struct parser {
     tokens: DVec<int>,
-};
+}
 
 trait parse {
     fn parse() -> ~[int];
@@ -20,7 +20,7 @@ trait parse {
 
 impl parse for parser {
     fn parse() -> ~[int] {
-        dvec::unwrap(self.tokens) //~ ERROR moving out of immutable field
+        ::core::dvec::unwrap(self.tokens) //~ ERROR moving out of immutable field
     }
 }
 
index c9aeaae0ff934e596bc94abe120ce74f3a4c454c..1f425b0922337431c2ee51be5de60b3f73bdd496 100644 (file)
@@ -13,7 +13,7 @@
 // we let an impl method can have more permissive bounds than the trait
 // method it's implementing, the return type might be less specific than
 // needed. Just punt and make it invariant.
-use iter::BaseIter;
+use core::iter::BaseIter;
 
 trait A {
   fn b<C:Copy + Const,D>(x: C) -> C;
index fb7c5bd6cb87b21c49e327f91676e5547ea083b6..ae7869d4a6890d0c63f2349c62c4de26eb45425c 100644 (file)
@@ -10,7 +10,7 @@
 
 // Tests that an impl method's bounds aren't *more* restrictive
 // than the trait method it's implementing
-use iter::BaseIter;
+use core::iter::BaseIter;
 
 trait A {
   fn b<C:Copy,D>(x: C) -> C;
index 35015a260f5af16a1614cebb78542a79d2c79dc5..c28fd462b410b796d38def7a6f131fb2aa5371cd 100644 (file)
@@ -10,7 +10,7 @@
 
 // Tests that ty params get matched correctly when comparing
 // an impl against a trait
-use iter::BaseIter;
+use core::iter::BaseIter;
 
 trait A {
   fn b<C:Copy,D>(x: C) -> C;
index 90ca7c1797c3ac7e1ea217b17ac4b4d6e4c5797e..c88a94ef62969427df6e80d3c6cd3b234f26df77 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use cmp::Eq;
+use core::cmp::Eq;
 
 trait Hahaha: Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq //~ ERROR Duplicate supertrait in trait declaration
               Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq Eq
index ba219f7b5fd2a51cbfec631450e17f5af7c51adf..f337914da6dcac63761259bfcdac119721420b64 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 extern mod std;
-use cmp::Eq;
+use core::cmp::Eq;
 
 fn f<T:Eq>(o: &mut Option<T>) {
     assert *o == option::None;
index 29eb1ec8d0a3fdec6428e06177d825e0b855aff1..7e65d1908c4d115f9bb1fbcc14ebf7a244b77996 100644 (file)
@@ -11,7 +11,6 @@
 
 
 extern mod std;
-use option::Some;
 
 // error-pattern: mismatched types
 
index bb4e97f9101b995a7af4e34c4d06eb71c26d1bc5..6b3b6f1463f58b6f335b1575d4c67d3db6e4ed78 100644 (file)
@@ -10,7 +10,6 @@
 // except according to those terms.
 
 extern mod std;
-use option::Some;
 
 // error-pattern: mismatched types
 
index f9ea3c6f933a3f5fbeed89f8f648cbaa18ecc778..c25205c58d1960043257f69ae0393e5084db563a 100644 (file)
@@ -11,7 +11,7 @@
 mod argparse {
     extern mod std;
 
-    use either::{Either, Left, Right};
+    use core::either::{Either, Left, Right};
 
     pub struct Flag {
         name: &str,
index a518816533e48d160a3b86ba95aabdd787b79453..9ca343e3866b883d0831774e071e2c7bb9b1a102 100644 (file)
@@ -11,7 +11,7 @@
 // error-pattern:explicit failure
 // Don't double free the string
 extern mod std;
-use io::ReaderUtil;
+use core::io::ReaderUtil;
 
 fn main() {
     do io::with_str_reader(~"") |rdr| {
index b50836beaa2e6af9927985d9ff3e9318d1a4bfd2..6f7276af798deba6e95cd2967c4b67413c8efec0 100644 (file)
@@ -12,7 +12,7 @@
 // the assert should fail at runtime
 // error-pattern:Assertion same_length(chars, ints) failed
 extern mod std;
-use vec::{same_length, zip};
+use core::vec::{same_length, zip};
 
 fn enum_chars(start: u8, end: u8) -> ~[char] {
     assert start < end;
index e4004c6dc22174202403ec9a8ec318bc47312b52..171e7a836bee15d7aed1af48403f441ac6deaf9c 100644 (file)
 // These tests used to be separate files, but I wanted to refactor all
 // the common code.
 
-use cmp::Eq;
-use std::ebml;
 use EBReader = std::ebml::reader;
 use EBWriter = std::ebml::writer;
-use io::Writer;
-use std::serialize::{Encodable, Decodable};
+use core::cmp::Eq;
+use core::io::Writer;
+use std::ebml;
 use std::prettyprint;
+use std::serialize::{Encodable, Decodable};
 use std::time;
 
 fn test_prettyprint<A:Encodable<prettyprint::Serializer>>(
index 72f6d23cacce133e2e6f9ab0bf77a85c899e0adb..a6d8eac3bd16387640e40a96b513a70d6eee9385 100644 (file)
@@ -9,10 +9,10 @@
 // except according to those terms.
 
 pub fn main() {
-    use vec::from_fn;
-    log(debug, vec::len(from_fn(2, |i| i)));
+    use core::vec::from_fn;
+    log(debug, ::core::vec::len(from_fn(2, |i| i)));
     {
-        use vec::*;
+        use core::vec::*;
         log(debug, len(~[2]));
     }
 }
index dedb2f2a99d5e985106a3d40d8a4fdd3d5b85d87..972a36697317184c0f653bc4e104b0a8e03fe1c9 100644 (file)
@@ -12,7 +12,7 @@
 
 
 use baz::zed;
-use zed::bar;
+use baz::zed::bar;
 
 mod baz {
     pub mod zed {
index 88b839c0c08a462b3c0b278446d585c05ac73c77..bbdbdd54f91f68d6ab6d90672aa5976cf4182ebf 100644 (file)
@@ -18,6 +18,6 @@ pub mod zed {
     }
 }
 mod bar {
-    pub use zed::baz;
+    pub use foo::zed::baz;
 }
 pub fn main() { baz(); }
index d5e15ea48e95197e21799f33d08d16bf37811120..4c6cc3458c43b593c660ced874d4b4815c82ba12 100644 (file)
@@ -18,7 +18,7 @@ pub mod zed {
     }
 }
 mod bar {
-    pub use zed::baz;
+    pub use foo::zed::baz;
     pub mod foo {
         pub mod zed {}
     }
index b70a9670df193010089c71afe22659b0994c8023..7b3247fafc7d4ec5ccd51d4b1757819975f7d3cd 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use iter::BaseIter;
+use core::iter::BaseIter;
 
 trait FlatMapToVec<A> {
   fn flat_map_to_vec<B, IB:BaseIter<B>>(op: fn(&A) -> IB) -> ~[B];
index 613652ec8524d5deb7dca938d79c46677c907f6b..2b4acc34f4659ba77960daba1ba8b79ec8e7e2f7 100644 (file)
 // except according to those terms.
 
 extern mod std;
-use io::WriterUtil;
+use core::io::WriterUtil;
 use std::oldmap::HashMap;
 use std::json;
 
-enum object
-{
+enum object {
     bool_value(bool),
     int_value(i64),
 }
index 3ed7d2f842d12b77adfea305036aa95b3fba7e3c..3340a387a128c4e6bb6989a0302fa4ace3392c6a 100644 (file)
@@ -12,7 +12,7 @@
 
 /// Map representation
 
-use io::ReaderUtil;
+use core::io::ReaderUtil;
 
 extern mod std;
 
index e441fa22b3150d74d420fde6cc7e761d57d252ce..e0c074c968f38081ddb254372e57ddc1d5e872a0 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-fast
 
-use comm::{Select2, Selectable};
+use core::comm::{Select2, Selectable};
 
 pub fn main() {
     let (p,c) = comm::stream();
index 5d6367df3b6abc9c9e967e48657aacd58437a351..e4649ed047036a74edbca271bf4bebdd362ca226 100644 (file)
@@ -12,7 +12,7 @@
 
 // rustc --test ignores2.rs && ./ignores2
 extern mod std;
-use path::{Path};
+use core::path::{Path};
 
 type rsrc_loader = fn~ (path: &Path) -> result::Result<~str, ~str>;
 
index f66a3cc474c20ce47a8ddc266c18a36cd7b92968..4671b25ce22d4c1ea5664940e3885137c1793e6e 100644 (file)
@@ -20,7 +20,7 @@
 
 // Extern mod controls linkage. Use controls the visibility of names to modules that are
 // already linked in. Using WriterUtil allows us to use the write_line method.
-use io::WriterUtil;
+use core::io::WriterUtil;
 
 // Represents a position on a canvas.
 struct Point {
index 83703dacc36e3abf8d0f4abf4f0ed4c4c53b9ba7..cc774e213760e656b7e84d9c4ee6b58839b09bba 100644 (file)
@@ -1,6 +1,6 @@
 extern mod std;
 
-use comm::Chan;
+use core::comm::Chan;
 
 type RingBuffer = ~[float];
 type SamplesFn = fn~ (samples: &RingBuffer);
index 3bc1b6c1eba9c0b6957444190d50777001b8fd8e..267f365c7134c3adff8e0e0fdb0579da709eac25 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use io::println;
+use core::io::println;
 
 pub fn main() {
     println("Hello world!");
index c472e5305840503a957e109f0b24f7ce50cd4e02..541d898c1ff2f66ca981b6903fa5c2fb93d2fb2b 100644 (file)
@@ -11,9 +11,9 @@
 // xfail-fast
 
 use core::bool;
+use core::libc::c_void;
+use core::vec::UnboxedVecRepr;
 use intrinsic::{TyDesc, get_tydesc, visit_tydesc, TyVisitor};
-use libc::c_void;
-use vec::UnboxedVecRepr;
 
 #[doc = "High-level interfaces to `intrinsic::visit_ty` reflection system."]
 
index 5c1255f2aa2d6f285888ab9114b502741be2928d..12e8ab1384fccc4f79e04603d52c42d62b24ec52 100644 (file)
@@ -11,7 +11,9 @@
 // except according to those terms.
 
 extern mod std;
-use libc, sys, cast;
+use core::libc;
+use core::sys;
+use core::cast;
 use std::arena::Arena;
 
 struct Bcx {
index 2f0f9e5ae6ad7a18d6101a6ba9e9744a477143ec..3f11a9bdce3c7da7cba06ac61b4786c2ac1eeef6 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-fast
 
-use cmp::Eq;
+use core::cmp::Eq;
 
 fn iter<T>(v: ~[T], it: fn(&T) -> bool) {
     let mut i = 0u, l = v.len();
index 21d494e008867f5c4e89bd52a206829d300006f4..c39a0f36d5804a4ee2757c6d1272f900c3ed10d6 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-fast
 
 extern mod std;
-use io::WriterUtil;
+use core::io::WriterUtil;
 use std::tempfile;
 
 pub fn main() {
index f260e571b42ac66edb7c14a2fd216777eff3b96f..3e71875c4b5c0803106c58ef77509bea3c6a49fc 100644 (file)
@@ -13,8 +13,8 @@
 
 extern mod std;
 
-use comm::Chan;
-use comm::Port;
+use core::comm::Chan;
+use core::comm::Port;
 
 pub fn main() { test05(); }
 
index 4e46d6b2b18b099f9cefe1d8cd03206411ac73f2..36b1e6cd4de405dd49ed5f533bd81ad1131203f9 100644 (file)
@@ -10,8 +10,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use cmp::{Eq, Ord};
-use num::NumCast::from;
+use core::cmp::{Eq, Ord};
+use core::num::NumCast::from;
 
 extern mod std;
 use std::cmp::FuzzyEq;
index 1996e05618a0d319d373047d2d0aedca4690ecef..70eed496db3f551844f868d8931fa0596a8d4af4 100644 (file)
@@ -12,7 +12,7 @@
 
 // Extending Num and using inherited static methods
 
-use num::NumCast::from;
+use core::num::NumCast::from;
 
 trait Num {
     static fn from_int(i: int) -> Self;
index 03230dc39af3572ce101b3672a1e12c04b520008..44b4bd60f1de064f8b14dee7583afa16eecc4744 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use cmp::Ord;
-use num::NumCast::from;
+use core::cmp::Ord;
+use core::num::NumCast::from;
 
 pub trait NumExt: NumCast Ord { }
 
index f20181d22d344d7b3f92464309ab16ce1c483d5e..5c9d9e6a13b5fee6b8536ff752df5a1b035c3076 100644 (file)
@@ -12,8 +12,8 @@
 
 // A more complex example of numeric extensions
 
-use cmp::{Eq, Ord};
-use num::NumCast::from;
+use core::cmp::{Eq, Ord};
+use core::num::NumCast::from;
 
 extern mod std;
 use std::cmp::FuzzyEq;
index adb9f01fff8a87ca3e865b98e954a05229bc65fa..c2cd56ad1078e8c1e8c2f644fe6cf00c0dd47926 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use cmp::{Eq, Ord};
-use num::NumCast::from;
+use core::cmp::{Eq, Ord};
+use core::num::NumCast::from;
 
 pub trait NumExt: Eq Ord NumCast {}
 
index d10126dddb6ccd60abd291f4989a42547ab112fe..ac8d80359d87482509a6b3dac8e069f6783a3b76 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use cmp::{Eq, Ord};
-use num::NumCast::from;
+use core::cmp::{Eq, Ord};
+use core::num::NumCast::from;
 
 pub trait NumExt: Eq NumCast {}
 
index b068d109ccfdb19e82bfa40a28cac4e198be18c5..7ecc15a0d812d03299e4356609f53fb3ec44206d 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use cmp::Eq;
+use core::cmp::Eq;
 
 trait MyNum : Eq { }
 
index 08f3d41ddad9bafbb8cbaf426b1515d92ff52d2c..54a9ea9ad1e32551c6bc75e823b1594a4aa5ca32 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use cmp::Eq;
+use core::cmp::Eq;
 
 trait MyNum : Add<Self,Self> Sub<Self,Self> Mul<Self,Self> Eq { }
 
index 180ce716dcc9d6e5e42998e834a59b39e99fe18d..3cc184572865be856abc44e06825710fd031a672 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use cmp::Eq;
+use core::cmp::Eq;
 
 fn sendable() {
 
index 167448cfe25b1754caae13f0ba52cc5e4876371e..1ade9e8246fdd9264817fbd3f8ca2db4823277ed 100644 (file)
@@ -10,7 +10,7 @@
 
 // In this case, the code should compile and should
 // succeed at runtime
-use vec::{head, last, same_length, zip};
+use core::vec::{head, last, same_length, zip};
 
 fn enum_chars(start: u8, end: u8) -> ~[char] {
     assert start < end;