]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Make `use` statements crate-relative by default. r=brson
authorPatrick Walton <pcwalton@mimiga.net>
Thu, 13 Dec 2012 21:05:22 +0000 (13:05 -0800)
committerPatrick Walton <pcwalton@mimiga.net>
Thu, 13 Dec 2012 21:05:22 +0000 (13:05 -0800)
226 files changed:
src/libcargo/cargo.rc
src/libcore/core.rc
src/libcore/int-template.rs
src/libcore/int-template/int.rs
src/libcore/iter-trait.rs
src/libcore/libc.rs
src/libcore/os.rs
src/libcore/send_map.rs
src/libcore/task/local_data.rs
src/libcore/task/local_data_priv.rs
src/libcore/task/mod.rs
src/libcore/task/spawn.rs
src/libcore/to_str.rs
src/libcore/uint-template.rs
src/libcore/uint-template/u8.rs
src/libcore/uint-template/uint.rs
src/librustc/driver/session.rs
src/librustc/front/intrinsic.rs
src/librustc/metadata/creader.rs
src/librustc/metadata/csearch.rs
src/librustc/metadata/decoder.rs
src/librustc/metadata/encoder.rs
src/librustc/metadata/loader.rs
src/librustc/metadata/mod.rs
src/librustc/metadata/tydecode.rs
src/librustc/middle/astencode.rs
src/librustc/middle/borrowck/gather_loans.rs
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/check_alt.rs
src/librustc/middle/const_eval.rs
src/librustc/middle/kind.rs
src/librustc/middle/liveness.rs
src/librustc/middle/privacy.rs
src/librustc/middle/region.rs
src/librustc/middle/resolve.rs
src/librustc/middle/trans/alt.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/build.rs
src/librustc/middle/trans/callee.rs
src/librustc/middle/trans/closure.rs
src/librustc/middle/trans/consts.rs
src/librustc/middle/trans/controlflow.rs
src/librustc/middle/trans/datum.rs
src/librustc/middle/trans/debuginfo.rs
src/librustc/middle/trans/expr.rs
src/librustc/middle/trans/foreign.rs
src/librustc/middle/trans/glue.rs
src/librustc/middle/trans/inline.rs
src/librustc/middle/trans/meth.rs
src/librustc/middle/trans/monomorphize.rs
src/librustc/middle/trans/reflect.rs
src/librustc/middle/trans/shape.rs
src/librustc/middle/trans/tvec.rs
src/librustc/middle/trans/type_of.rs
src/librustc/middle/trans/type_use.rs
src/librustc/middle/trans/uniq.rs
src/librustc/middle/typeck/astconv.rs
src/librustc/middle/typeck/check/alt.rs
src/librustc/middle/typeck/check/demand.rs
src/librustc/middle/typeck/check/method.rs
src/librustc/middle/typeck/check/mod.rs
src/librustc/middle/typeck/check/regionck.rs
src/librustc/middle/typeck/check/regionmanip.rs
src/librustc/middle/typeck/check/vtable.rs
src/librustc/middle/typeck/check/writeback.rs
src/librustc/middle/typeck/coherence.rs
src/librustc/middle/typeck/collect.rs
src/librustc/middle/typeck/infer/assignment.rs
src/librustc/middle/typeck/infer/combine.rs
src/librustc/middle/typeck/infer/floating.rs
src/librustc/middle/typeck/infer/glb.rs
src/librustc/middle/typeck/infer/integral.rs
src/librustc/middle/typeck/infer/lattice.rs
src/librustc/middle/typeck/infer/lub.rs
src/librustc/middle/typeck/infer/mod.rs
src/librustc/middle/typeck/infer/region_inference.rs
src/librustc/middle/typeck/infer/resolve.rs
src/librustc/middle/typeck/infer/sub.rs
src/librustc/middle/typeck/infer/to_str.rs
src/librustc/middle/typeck/infer/unify.rs
src/librustc/middle/typeck/mod.rs
src/librustc/middle/typeck/rscope.rs
src/librustc/rustc.rc
src/librustdoc/astsrv.rs
src/librustdoc/parse.rs
src/librusti/rusti.rc
src/libstd/serialization.rs
src/libstd/timer.rs
src/libstd/uv_global_loop.rs
src/libstd/uv_iotask.rs
src/libsyntax/ext/auto_serialize.rs
src/libsyntax/ext/build.rs
src/libsyntax/ext/concat_idents.rs
src/libsyntax/ext/deriving.rs
src/libsyntax/ext/env.rs
src/libsyntax/ext/fmt.rs
src/libsyntax/ext/log_syntax.rs
src/libsyntax/ext/pipes/ast_builder.rs
src/libsyntax/ext/pipes/check.rs
src/libsyntax/ext/pipes/mod.rs
src/libsyntax/ext/pipes/parse_proto.rs
src/libsyntax/ext/pipes/pipec.rs
src/libsyntax/ext/pipes/proto.rs
src/libsyntax/ext/quote.rs
src/libsyntax/ext/source_util.rs
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/ext/tt/transcribe.rs
src/libsyntax/parse/attr.rs
src/libsyntax/parse/comments.rs
src/libsyntax/parse/common.rs
src/libsyntax/parse/mod.rs
src/libsyntax/parse/obsolete.rs
src/libsyntax/parse/parser.rs
src/libsyntax/parse/prec.rs
src/libsyntax/print/pprust.rs
src/libsyntax/syntax.rc
src/test/auxiliary/cci_capture_clause.rs
src/test/auxiliary/pub_use_mods_xcrate.rs
src/test/compile-fail/super-at-top-level.rs [new file with mode: 0644]
src/test/run-pass/alias-uninit-value.rs
src/test/run-pass/alt-pattern-drop.rs
src/test/run-pass/auto-ref-bounded-ty-param.rs
src/test/run-pass/auto_serialize.rs
src/test/run-pass/basic-1.rs
src/test/run-pass/basic-2.rs
src/test/run-pass/basic.rs
src/test/run-pass/bind-by-move.rs
src/test/run-pass/binops.rs
src/test/run-pass/bitv-perf-test.rs
src/test/run-pass/borrowck-borrow-from-expr-block.rs
src/test/run-pass/call-closure-from-overloaded-op.rs
src/test/run-pass/capture_nil.rs
src/test/run-pass/chan-leak.rs
src/test/run-pass/class-exports.rs
src/test/run-pass/comm.rs
src/test/run-pass/conditional-compile.rs
src/test/run-pass/core-export-f64-sqrt.rs
src/test/run-pass/decl-with-recv.rs
src/test/run-pass/dvec-test.rs
src/test/run-pass/export-glob-imports-target.rs
src/test/run-pass/export-glob.rs
src/test/run-pass/export-multi.rs
src/test/run-pass/extern-mod-syntax.rs
src/test/run-pass/getopts_ref.rs
src/test/run-pass/guards-not-exhaustive.rs
src/test/run-pass/hashmap-memory.rs
src/test/run-pass/import-from-foreign.rs
src/test/run-pass/import-from.rs
src/test/run-pass/import-glob-0.rs
src/test/run-pass/import-glob-1.rs
src/test/run-pass/import-glob-crate.rs
src/test/run-pass/import-in-block.rs
src/test/run-pass/import-trailing-comma.rs
src/test/run-pass/import.rs
src/test/run-pass/import2.rs
src/test/run-pass/import3.rs
src/test/run-pass/import4.rs
src/test/run-pass/import5.rs
src/test/run-pass/import6.rs
src/test/run-pass/import7.rs
src/test/run-pass/import8.rs
src/test/run-pass/intrinsics-math.rs
src/test/run-pass/issue-1112.rs
src/test/run-pass/issue-1696.rs
src/test/run-pass/issue-2214.rs
src/test/run-pass/issue-2383.rs
src/test/run-pass/issue-2445.rs
src/test/run-pass/issue-2718.rs
src/test/run-pass/issue-2804-2.rs
src/test/run-pass/issue-2804.rs
src/test/run-pass/issue-2895.rs
src/test/run-pass/issue-2904.rs
src/test/run-pass/issue-3026.rs
src/test/run-pass/issue-3052.rs
src/test/run-pass/issue-3424.rs
src/test/run-pass/issue-3559.rs
src/test/run-pass/issue-3702.rs
src/test/run-pass/issue-507.rs
src/test/run-pass/issue-687.rs
src/test/run-pass/issue-783.rs
src/test/run-pass/ivec-tag.rs
src/test/run-pass/lazychan.rs
src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
src/test/run-pass/mod-merge-hack-template.rs
src/test/run-pass/mod-view-items.rs
src/test/run-pass/nested-pattern.rs
src/test/run-pass/non-boolean-pure-fns.rs
src/test/run-pass/pipe-bank-proto.rs
src/test/run-pass/pipe-detect-term.rs
src/test/run-pass/pipe-peek.rs
src/test/run-pass/pipe-pingpong-bounded.rs
src/test/run-pass/pipe-pingpong-proto.rs
src/test/run-pass/pipe-presentation-examples.rs
src/test/run-pass/pipe-select.rs
src/test/run-pass/pipe-sleep.rs
src/test/run-pass/placement-new-arena.rs
src/test/run-pass/reexport-star.rs
src/test/run-pass/regions-mock-trans-impls.rs
src/test/run-pass/regions-mock-trans.rs
src/test/run-pass/rt-circular-buffer.rs
src/test/run-pass/rt-sched-1.rs
src/test/run-pass/self-shadowing-import.rs
src/test/run-pass/send-resource.rs
src/test/run-pass/send-type-inference.rs
src/test/run-pass/sendfn-deep-copy.rs
src/test/run-pass/sendfn-spawn-with-fn-arg.rs
src/test/run-pass/shape_intrinsic_tag_then_rec.rs
src/test/run-pass/spawn-fn.rs
src/test/run-pass/spawn2.rs
src/test/run-pass/tag-exports.rs
src/test/run-pass/task-comm-16.rs
src/test/run-pass/task-comm-4.rs
src/test/run-pass/task-comm-6.rs
src/test/run-pass/task-comm.rs
src/test/run-pass/task-killjoin-rsrc.rs
src/test/run-pass/task-killjoin.rs
src/test/run-pass/trait-inheritance-num.rs
src/test/run-pass/trait-inheritance-num0.rs
src/test/run-pass/trait-inheritance-num2.rs
src/test/run-pass/unique-copy-box.rs
src/test/run-pass/use-mod.rs
src/test/run-pass/use.rs
src/test/run-pass/yield.rs
src/test/run-pass/yield1.rs
src/test/run-pass/yield2.rs
src/test/run-pass/zip-same-length.rs

index 2ced2026f6d8e9c5bea74cc5445a3c54700e2b51..4fc8ddd9cdb124448364fb0f49d3777ecfb50b13 100644 (file)
@@ -42,26 +42,25 @@ extern mod std(vers = "0.5");
 extern mod rustc(vers = "0.5");
 extern mod syntax(vers = "0.5");
 
-use core::*;
-
 #[legacy_exports]
 mod pgp;
 
-use syntax::{ast, codemap, parse, visit, attr};
-use syntax::diagnostic::span_handler;
-use codemap::span;
-use rustc::metadata::filesearch::{get_cargo_root, get_cargo_root_nearest,
-                                     get_cargo_sysroot, libdir};
-use syntax::diagnostic;
+use rustc::metadata::filesearch::{get_cargo_root, get_cargo_root_nearest};
+use rustc::metadata::filesearch::{get_cargo_sysroot, libdir};
 
-use result::{Ok, Err};
-use io::WriterUtil;
-use send_map::linear::LinearMap;
+use core::*;
+
+use core::dvec::DVec;
+use core::io::WriterUtil;
+use core::result::{Ok, Err};
+use core::send_map::linear::LinearMap;
+use std::getopts::{optflag, optopt, opt_present};
+use std::map::HashMap;
 use std::{map, json, tempfile, term, sort, getopts};
-use map::HashMap;
-use to_str::to_str;
-use getopts::{optflag, optopt, opt_present};
-use dvec::DVec;
+use syntax::codemap::span;
+use syntax::diagnostic::span_handler;
+use syntax::diagnostic;
+use syntax::{ast, codemap, parse, visit, attr};
 
 struct Package {
     name: ~str,
index 5f313244e2758292465206b43c91873af482af49..bfdc0a6eb0d6830c7ef839594e28cb54b92f6208 100644 (file)
@@ -247,7 +247,7 @@ mod core {
 #[cfg(test)]
 mod std {
     extern mod std(vers = "0.5");
-    pub use std::test;
+    pub use std::std::test;
 }
 
 
index dbeb51b813ff27829fd84648e91785b59b1d0a59..3878d6a5205336ee65d64b347d749b465bc08aad 100644 (file)
 #[forbid(deprecated_mode)];
 #[forbid(deprecated_pattern)];
 
+#[cfg(stage0)]
 use T = inst::T;
+#[cfg(stage1)]
+#[cfg(stage2)]
+use T = self::inst::T;
+
 use cmp::{Eq, Ord};
 use from_str::FromStr;
 use num::from_int;
index 87f5659e6f40869d599b16412e0ce95ac818a669..98d833adea98a872a13a13fc9edd8d6095d8ece2 100644 (file)
 
 //! Operations and constants for `int`
 
+#[cfg(stage0)]
 pub use inst::pow;
+#[cfg(stage1)]
+#[cfg(stage2)]
+pub use self::inst::pow;
 
 mod inst {
     pub type T = int;
@@ -54,4 +58,4 @@ fn test_overflows() {
         assert (min_value <= 0);
         assert (min_value + max_value + 1 == 0);
     }
-}
\ No newline at end of file
+}
index 861f55afc99f68b92c8dffc6aadea3de623d24e1..dfb91c49b7d577ed7e62560f4f15f10ee1be97a7 100644 (file)
 #[forbid(deprecated_pattern)];
 
 use cmp::{Eq, Ord};
+
+#[cfg(stage0)]
 use inst::{IMPL_T, EACH, SIZE_HINT};
+#[cfg(stage1)]
+#[cfg(stage2)]
+use self::inst::{IMPL_T, EACH, SIZE_HINT};
 
 impl<A> IMPL_T<A>: iter::BaseIter<A> {
     pure fn each(blk: fn(v: &A) -> bool) { EACH(&self, blk) }
index 64f63663098d870ecdcae317d9884bf7570a78af..80e3a22dcba221f78bfde6aba45758e363d41a20 100644 (file)
 // Initial glob-exports mean that all the contents of all the modules
 // wind up exported, if you're interested in writing platform-specific code.
 
-pub use types::common::c95::*;
-pub use types::common::c99::*;
-pub use types::common::posix88::*;
-pub use types::common::posix01::*;
-pub use types::common::posix08::*;
-pub use types::common::bsd44::*;
-pub use types::os::common::posix01::*;
-pub use types::os::arch::c95::*;
-pub use types::os::arch::c99::*;
-pub use types::os::arch::posix88::*;
-pub use types::os::arch::posix01::*;
-pub use types::os::arch::posix08::*;
-pub use types::os::arch::bsd44::*;
-pub use types::os::arch::extra::*;
-
-pub use consts::os::c95::*;
-pub use consts::os::c99::*;
-pub use consts::os::posix88::*;
-pub use consts::os::posix01::*;
-pub use consts::os::posix08::*;
-pub use consts::os::bsd44::*;
-pub use consts::os::extra::*;
-
-pub use funcs::c95::ctype::*;
-pub use funcs::c95::stdio::*;
-pub use funcs::c95::stdlib::*;
-pub use funcs::c95::string::*;
-
-pub use funcs::posix88::stat_::*;
-pub use funcs::posix88::stdio::*;
-pub use funcs::posix88::fcntl::*;
-pub use funcs::posix88::dirent::*;
-pub use funcs::posix88::unistd::*;
-
-pub use funcs::posix01::stat_::*;
-pub use funcs::posix01::unistd::*;
-pub use funcs::posix08::unistd::*;
-
-pub use funcs::bsd44::*;
-pub use funcs::extra::*;
+pub use libc::types::common::c95::*;
+pub use libc::types::common::c99::*;
+pub use libc::types::common::posix88::*;
+pub use libc::types::common::posix01::*;
+pub use libc::types::common::posix08::*;
+pub use libc::types::common::bsd44::*;
+pub use libc::types::os::common::posix01::*;
+pub use libc::types::os::arch::c95::*;
+pub use libc::types::os::arch::c99::*;
+pub use libc::types::os::arch::posix88::*;
+pub use libc::types::os::arch::posix01::*;
+pub use libc::types::os::arch::posix08::*;
+pub use libc::types::os::arch::bsd44::*;
+pub use libc::types::os::arch::extra::*;
+
+pub use libc::consts::os::c95::*;
+pub use libc::consts::os::c99::*;
+pub use libc::consts::os::posix88::*;
+pub use libc::consts::os::posix01::*;
+pub use libc::consts::os::posix08::*;
+pub use libc::consts::os::bsd44::*;
+pub use libc::consts::os::extra::*;
+
+pub use libc::funcs::c95::ctype::*;
+pub use libc::funcs::c95::stdio::*;
+pub use libc::funcs::c95::stdlib::*;
+pub use libc::funcs::c95::string::*;
+
+pub use libc::funcs::posix88::stat_::*;
+pub use libc::funcs::posix88::stdio::*;
+pub use libc::funcs::posix88::fcntl::*;
+pub use libc::funcs::posix88::dirent::*;
+pub use libc::funcs::posix88::unistd::*;
+
+pub use libc::funcs::posix01::stat_::*;
+pub use libc::funcs::posix01::unistd::*;
+pub use libc::funcs::posix08::unistd::*;
+
+pub use libc::funcs::bsd44::*;
+pub use libc::funcs::extra::*;
+
+#[cfg(target_os = "win32")]
+pub use libc::funcs::extra::kernel32::*;
+#[cfg(target_os = "win32")]
+pub use libc::funcs::extra::msvcrt::*;
 
 // Explicit export lists for the intersection (provided here) mean that
 // you can write more-platform-agnostic code if you stick to just these
 // symbols.
 
-pub use size_t;
-pub use c_float, c_double, c_void, FILE, fpos_t;
-pub use DIR, dirent_t;
-pub use c_char, c_schar, c_uchar;
-pub use c_short, c_ushort, c_int, c_uint, c_long, c_ulong;
-pub use size_t, ptrdiff_t, clock_t, time_t;
-pub use c_longlong, c_ulonglong, intptr_t, uintptr_t;
-pub use off_t, dev_t, ino_t, pid_t, mode_t, ssize_t;
-
-pub use EXIT_FAILURE, EXIT_SUCCESS, RAND_MAX,
-EOF, SEEK_SET, SEEK_CUR, SEEK_END, _IOFBF, _IONBF, _IOLBF,
-BUFSIZ, FOPEN_MAX, FILENAME_MAX, L_tmpnam, TMP_MAX,
-O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_CREAT, O_EXCL, O_TRUNC,
-S_IFIFO, S_IFCHR, S_IFBLK, S_IFDIR, S_IFREG, S_IFMT, S_IEXEC,
-S_IWRITE, S_IREAD, S_IRWXU, S_IXUSR, S_IWUSR, S_IRUSR, F_OK, R_OK,
-W_OK, X_OK, STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO;
-
-pub use isalnum, isalpha, iscntrl, isdigit, islower, isprint, ispunct,
-isspace, isupper, isxdigit, tolower, toupper;
-
-pub use fopen, freopen, fflush, fclose, remove, tmpfile, setvbuf, setbuf,
-fgetc, fgets, fputc, fputs, puts, ungetc, fread, fwrite, fseek, ftell,
-rewind, fgetpos, fsetpos, feof, ferror, perror;
-
-pub use abs, labs, atof, atoi, strtod, strtol, strtoul, calloc, malloc,
-realloc, free, abort, exit, system, getenv, rand, srand;
-
-pub use strcpy, strncpy, strcat, strncat, strcmp, strncmp, strcoll, strchr,
-strrchr, strspn, strcspn, strpbrk, strstr, strlen, strerror, strtok,
-strxfrm, memcpy, memmove, memcmp, memchr, memset;
-
-pub use chmod, mkdir;
-pub use popen, pclose, fdopen, fileno;
-pub use open, creat;
-pub use access, chdir, close, dup, dup2, execv, execve, execvp, getcwd,
-getpid, isatty, lseek, pipe, read, rmdir, unlink, write;
-
-pub use fstat, stat;
+pub use libc::types::common::c95::{FILE, c_void, fpos_t};
+pub use libc::types::common::posix88::{DIR, dirent_t};
+pub use libc::types::os::arch::c95::{c_char, c_double, c_float, c_int};
+pub use libc::types::os::arch::c95::{c_long, c_short, c_uchar, c_ulong};
+pub use libc::types::os::arch::c95::{c_ushort, clock_t, ptrdiff_t};
+pub use libc::types::os::arch::c95::{size_t, time_t};
+pub use libc::types::os::arch::c99::{c_longlong, c_ulonglong, intptr_t};
+pub use libc::types::os::arch::c99::{uintptr_t};
+pub use libc::types::os::arch::posix88::{dev_t, dirent_t, ino_t, mode_t};
+pub use libc::types::os::arch::posix88::{off_t, pid_t, ssize_t};
+
+pub use libc::consts::os::c95::{_IOFBF, _IOLBF, _IONBF, BUFSIZ, EOF};
+pub use libc::consts::os::c95::{EXIT_FAILURE, EXIT_SUCCESS};
+pub use libc::consts::os::c95::{FILENAME_MAX, FOPEN_MAX, L_tmpnam};
+pub use libc::consts::os::c95::{RAND_MAX, SEEK_CUR, SEEK_END};
+pub use libc::consts::os::c95::{SEEK_SET, TMP_MAX};
+pub use libc::consts::os::posix88::{F_OK, O_APPEND, O_CREAT, O_EXCL};
+pub use libc::consts::os::posix88::{O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY};
+pub use libc::consts::os::posix88::{R_OK, S_IEXEC, S_IFBLK, S_IFCHR};
+pub use libc::consts::os::posix88::{S_IFDIR, S_IFIFO, S_IFMT, S_IFREG};
+pub use libc::consts::os::posix88::{S_IREAD, S_IRUSR, S_IRWXU, S_IWUSR};
+pub use libc::consts::os::posix88::{STDERR_FILENO, STDIN_FILENO};
+pub use libc::consts::os::posix88::{STDOUT_FILENO, W_OK, X_OK};
+
+pub use libc::funcs::c95::ctype::{isalnum, isalpha, iscntrl, isdigit};
+pub use libc::funcs::c95::ctype::{islower, isprint, ispunct, isspace};
+pub use libc::funcs::c95::ctype::{isupper, isxdigit, tolower, toupper};
+
+pub use libc::funcs::c95::stdio::{fclose, feof, ferror, fflush, fgetc};
+pub use libc::funcs::c95::stdio::{fgetpos, fgets, fopen, fputc, fputs};
+pub use libc::funcs::c95::stdio::{fread, freopen, fseek, fsetpos, ftell};
+pub use libc::funcs::c95::stdio::{fwrite, perror, puts, remove, rewind};
+pub use libc::funcs::c95::stdio::{setbuf, setvbuf, tmpfile, ungetc};
+
+pub use libc::funcs::c95::stdlib::{abort, abs, atof, atoi, calloc, exit};
+pub use libc::funcs::c95::stdlib::{free, getenv, labs, malloc, rand};
+pub use libc::funcs::c95::stdlib::{realloc, srand, strtod, strtol};
+pub use libc::funcs::c95::stdlib::{strtoul, system};
+
+pub use libc::funcs::c95::string::{memchr, memcmp, memcpy, memmove};
+pub use libc::funcs::c95::string::{memset, strcat, strchr, strcmp};
+pub use libc::funcs::c95::string::{strcoll, strcpy, strcspn, strerror};
+pub use libc::funcs::c95::string::{strlen, strncat, strncmp, strncpy};
+pub use libc::funcs::c95::string::{strpbrk, strrchr, strspn, strstr};
+pub use libc::funcs::c95::string::{strtok, strxfrm};
+
+pub use libc::funcs::posix88::fcntl::{open, creat};
+pub use libc::funcs::posix88::stat_::{chmod, fstat, mkdir, stat};
+pub use libc::funcs::posix88::stdio::{fdopen, fileno, pclose, popen};
+pub use libc::funcs::posix88::unistd::{access, chdir, close, dup, dup2};
+pub use libc::funcs::posix88::unistd::{execv, execve, execvp, getcwd};
+pub use libc::funcs::posix88::unistd::{getpid, isatty, lseek, pipe, read};
+pub use libc::funcs::posix88::unistd::{rmdir, unlink, write};
 
 
 mod types {
@@ -1365,10 +1385,6 @@ pub mod extra {
 
     #[cfg(target_os = "win32")]
     pub mod extra {
-        use types::os::arch::extra::*;
-        pub use kernel32::*;
-        pub use msvcrt::*;
-
         #[abi = "stdcall"]
         pub extern mod kernel32 {
             fn GetEnvironmentVariableW(n: LPCWSTR,
@@ -1396,7 +1412,7 @@ fn CopyFileW(lpExistingFileName: LPCWSTR,
         #[nolink]
         pub extern mod msvcrt {
             #[link_name = "_commit"]
-            fn commit(fd: c_int) -> c_int;
+            pub fn commit(fd: c_int) -> c_int;
         }
     }
 }
index e793155c267a98c8aa6585e28d8bb18cd8117fc9..c3bf8df5114ed427e269f24eb2474725a51d55a1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2012 The Rust Project Developers.src/libcore/os.rs
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
@@ -36,7 +36,7 @@
 
 use option::{Some, None};
 
-pub use consts::*;
+pub use os::consts::*;
 use task::TaskBuilder;
 
 // FIXME: move these to str perhaps? #2620
@@ -77,8 +77,8 @@ pub fn fill_charp_buf(f: fn(*mut c_char, size_t) -> bool)
 }
 
 #[cfg(windows)]
-mod win32 {
-    use libc::DWORD;
+pub mod win32 {
+    use libc::types::os::arch::extra::DWORD;
 
     pub fn fill_utf16_buf_and_decode(f: fn(*mut u16, DWORD) -> DWORD)
         -> Option<~str> {
@@ -224,7 +224,7 @@ pub fn getenv(n: &str) -> Option<~str> {
 
         #[cfg(windows)]
         pub fn getenv(n: &str) -> Option<~str> {
-            use win32::*;
+            use os::win32::*;
             do as_utf16_p(n) |u| {
                 do fill_utf16_buf_and_decode() |buf, sz| {
                     libc::GetEnvironmentVariableW(u, buf, sz)
@@ -245,7 +245,7 @@ pub fn setenv(n: &str, v: &str) {
 
         #[cfg(windows)]
         pub fn setenv(n: &str, v: &str) {
-            use win32::*;
+            use os::win32::*;
             do as_utf16_p(n) |nbuf| {
                 do as_utf16_p(v) |vbuf| {
                     libc::SetEnvironmentVariableW(nbuf, vbuf);
@@ -403,7 +403,7 @@ fn load_self() -> Option<~str> {
 
     #[cfg(windows)]
     fn load_self() -> Option<~str> {
-        use win32::*;
+        use os::win32::*;
         do fill_utf16_buf_and_decode() |buf, sz| {
             libc::GetModuleFileNameW(0u as libc::DWORD, buf, sz)
         }
@@ -566,7 +566,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool {
 
     #[cfg(windows)]
     fn mkdir(p: &Path, _mode: c_int) -> bool {
-        use win32::*;
+        use os::win32::*;
         // FIXME: turn mode into something useful? #2623
         do as_utf16_p(p.to_str()) |buf| {
             libc::CreateDirectoryW(buf, unsafe {
@@ -614,7 +614,7 @@ pub fn remove_dir(p: &Path) -> bool {
 
     #[cfg(windows)]
     fn rmdir(p: &Path) -> bool {
-        use win32::*;
+        use os::win32::*;
         return do as_utf16_p(p.to_str()) |buf| {
             libc::RemoveDirectoryW(buf) != (0 as libc::BOOL)
         };
@@ -633,7 +633,7 @@ pub fn change_dir(p: &Path) -> bool {
 
     #[cfg(windows)]
     fn chdir(p: &Path) -> bool {
-        use win32::*;
+        use os::win32::*;
         return do as_utf16_p(p.to_str()) |buf| {
             libc::SetCurrentDirectoryW(buf) != (0 as libc::BOOL)
         };
@@ -653,7 +653,7 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
 
     #[cfg(windows)]
     fn do_copy_file(from: &Path, to: &Path) -> bool {
-        use win32::*;
+        use os::win32::*;
         return do as_utf16_p(from.to_str()) |fromp| {
             do as_utf16_p(to.to_str()) |top| {
                 libc::CopyFileW(fromp, top, (0 as libc::BOOL)) !=
@@ -713,7 +713,7 @@ pub fn remove_file(p: &Path) -> bool {
 
     #[cfg(windows)]
     fn unlink(p: &Path) -> bool {
-        use win32::*;
+        use os::win32::*;
         return do as_utf16_p(p.to_str()) |buf| {
             libc::DeleteFileW(buf) != (0 as libc::BOOL)
         };
index 4a8fe459b375741504fb950ca5f82a5e33ef841d..af6b2c163779b2ecd13c081036bce839c4ea6e23 100644 (file)
@@ -451,7 +451,7 @@ impl<K:Hash IterBytes Eq, V: Eq> LinearMap<K, V>: cmp::Eq {
 
 #[test]
 pub mod test {
-    use linear::LinearMap;
+    use send_map::linear::LinearMap;
 
     #[test]
     pub fn inserts() {
index cc0353a354b699ce358ed694c672c1db67f515fa..ca8cc67dc4a90a9093dcd022ce78ea20242c616c 100644 (file)
@@ -26,7 +26,7 @@
 
 */
 
-use local_data_priv::{
+use task::local_data_priv::{
     local_pop,
     local_get,
     local_set,
index 494801d88ea4e6282d67fb288535ab26b234a18a..a5ae3291b877e9c2dc79547ad2addc5334311b67 100644 (file)
 
 #[doc(hidden)]; // FIXME #3538
 
-use local_data::LocalDataKey;
+use task::local_data::LocalDataKey;
+
+#[cfg(notest)]
 use rt::rust_task;
+#[cfg(test)]
+#[allow(non_camel_case_types)]
+type rust_task = libc::c_void;
 
 pub trait LocalData { }
 impl<T: Owned> @T: LocalData { }
index 98da3f50318d1888bb9d79335a913fb4340d7a9a..d9b040abf7bf4311f376a41416261f32be9dd311 100644 (file)
 use cmp::Eq;
 use result::Result;
 use pipes::{stream, Chan, Port};
-use local_data_priv::{local_get, local_set};
+use task::local_data_priv::{local_get, local_set};
+use task::rt::{task_id, rust_task};
 use util::replace;
 
-use rt::task_id;
-use rt::rust_task;
-
 mod local_data_priv;
 pub mod local_data;
 pub mod rt;
index 61e358e1e30e4c075a2f03997d4140be15281765..e2ed853ee2932e7d6a3e6235b353ebd29428762a 100644 (file)
@@ -73,8 +73,8 @@
 #[doc(hidden)]; // FIXME #3538
 #[warn(deprecated_mode)];
 
-use rt::rust_task;
-use rt::rust_closure;
+use task::rt::rust_task;
+use task::rt::rust_closure;
 
 macro_rules! move_it (
     { $x:expr } => ( unsafe { let y = move *ptr::addr_of(&($x)); move y } )
index 7f9aa28e364ca7962d37e0442eacbb9dea6e0fb1..55055470f10f1303a1f33cfeab9db84849a7ca72 100644 (file)
@@ -18,7 +18,7 @@
 #[forbid(deprecated_mode)];
 #[forbid(deprecated_pattern)];
 
-pub trait ToStr { pure fn to_str() -> ~str; }
+pub trait ToStr { pub pure fn to_str() -> ~str; }
 
 impl int: ToStr {
     pure fn to_str() -> ~str { int::str(self) }
index 8a03b0f94bcd8c5b081592dbfb75585dd07b5af7..a7d37c3ae61ab2b4ef5614496a7425a3c6b30247 100644 (file)
 #[forbid(deprecated_mode)];
 #[forbid(deprecated_pattern)];
 
+#[cfg(stage0)]
 use T = inst::T;
+#[cfg(stage1)]
+#[cfg(stage2)]
+use T = self::inst::T;
+
 use cmp::{Eq, Ord};
 use from_str::FromStr;
 
index 81635bf1e7f939ac5e432a83d9ee5a83cc539c15..4d0b3f2d4b71827c992aa6d26ebfd8a2ff624c6f 100644 (file)
 
 //! Operations and constants for `u8`
 
+#[cfg(stage0)]
 pub use inst::is_ascii;
+#[cfg(stage1)]
+#[cfg(stage2)]
+pub use self::inst::is_ascii;
 
 mod inst {
     pub type T = u8;
index 718d7956b316d394e8e44b15cf578380802d3299..8451d78d8e0dc7d4500bb0d523410d72b81b0c25 100644 (file)
 
 //! Operations and constants for `uint`
 
+#[cfg(stage0)]
 pub use inst::{
     div_ceil, div_round, div_floor, iterate,
     next_power_of_two
 };
+#[cfg(stage1)]
+#[cfg(stage2)]
+pub use self::inst::{
+    div_ceil, div_round, div_floor, iterate,
+    next_power_of_two
+};
 
 mod inst {
     pub type T = uint;
@@ -169,4 +176,4 @@ fn test_div() {
         assert(uint::div_ceil(3u, 4u)  == 1u);
         assert(uint::div_round(3u, 4u) == 1u);
     }
-}
\ No newline at end of file
+}
index 38594ea2c17ff2cf8f73fc873694a82997f2ae92..b2cb6da78ddc283accb5ca76645fca1f5bf6eb9c 100644 (file)
@@ -9,15 +9,16 @@
 // except according to those terms.
 
 
-use syntax::{ast, codemap};
+use back::link;
+use back::target_strs;
+use metadata::filesearch;
+use middle::lint;
+
 use syntax::ast::node_id;
-use codemap::span;
 use syntax::ast::{int_ty, uint_ty, float_ty};
+use syntax::codemap::span;
 use syntax::parse::parse_sess;
-use metadata::filesearch;
-use back::target_strs;
-use back::link;
-use middle::lint;
+use syntax::{ast, codemap};
 
 
 enum os { os_win32, os_macos, os_linux, os_freebsd, }
index 8a65ac6894b38ed6e24da3167e770fec792fe415..8703e6047444959558c4e6bb9a52bdd75bddf3c0 100644 (file)
@@ -14,7 +14,7 @@
 mod intrinsic {
     #[legacy_exports];
 
-    pub use rusti::visit_tydesc;
+    pub use intrinsic::rusti::visit_tydesc;
 
     // FIXME (#3727): remove this when the interface has settled and the
     // version in sys is no longer present.
index 9c734f8e69873223ab02d4edb3850d5a3aed768b..bebddec94d34d10cb7d5f0525b36621624710e22 100644 (file)
@@ -17,8 +17,8 @@
 use syntax::codemap::span;
 use std::map::HashMap;
 use syntax::print::pprust;
-use filesearch::FileSearch;
-use common::*;
+use metadata::filesearch::FileSearch;
+use metadata::common::*;
 use dvec::DVec;
 use syntax::parse::token::ident_interner;
 
index 9dc4a01b7316d78478ae421ebf49e83db906d039..ae56cf45dbcf28d9248d1afbfc48e7c7a1ee7368 100644 (file)
 
 // Searching for information from the cstore
 
-use std::ebml;
+use metadata::common::*;
+use middle::ty;
+
+use core::dvec::DVec;
+use core::option::{Some, None};
 use reader = std::ebml::reader;
+use std::ebml;
+use std::map::HashMap;
 use syntax::ast;
-use syntax::ast_util;
 use syntax::ast_map;
-use middle::ty;
-use option::{Some, None};
-use syntax::diagnostic::span_handler;
+use syntax::ast_util::dummy_sp;
+use syntax::ast_util;
 use syntax::diagnostic::expect;
-use ast_util::dummy_sp;
-use common::*;
-use std::map::HashMap;
-use dvec::DVec;
+use syntax::diagnostic::span_handler;
 
 export struct_dtor;
 export get_symbol;
index 110b151a651efc64d26f9d1cb19e8c281fa9b0cb..1e86eb78cfe3f8ad7cbb33c072abcf8948d2dd08 100644 (file)
 
 // Decoding metadata from a single crate's metadata
 
+use cmd = metadata::cstore::crate_metadata;
+use dvec::DVec;
+use hash::{Hash, HashUtil};
+use io::WriterUtil;
+use metadata::common::*;
+use metadata::csearch::{ProvidedTraitMethodInfo, StaticMethodInfo};
+use metadata::tydecode::{parse_ty_data, parse_def_id, parse_bounds_data};
+use metadata::tydecode::{parse_ident};
+use middle::ty;
+use util::ppaux::ty_to_str;
+
+use reader = std::ebml::reader;
 use std::ebml;
-use std::map;
 use std::map::HashMap;
+use std::map;
 use std::serialization::deserialize;
-use reader = ebml::reader;
-use io::WriterUtil;
-use dvec::DVec;
-use syntax::{ast, ast_util};
-use syntax::attr;
-use middle::ty;
 use syntax::ast_map;
-use tydecode::{parse_ty_data, parse_def_id, parse_bounds_data,
-        parse_ident};
-use syntax::print::pprust;
-use cmd=cstore::crate_metadata;
-use util::ppaux::ty_to_str;
+use syntax::attr;
 use syntax::diagnostic::span_handler;
-use common::*;
 use syntax::parse::token::ident_interner;
-use hash::{Hash, HashUtil};
-use csearch::{ProvidedTraitMethodInfo, StaticMethodInfo};
+use syntax::print::pprust;
+use syntax::{ast, ast_util};
 
 export struct_dtor;
 export get_struct_fields;
index e2a4b8880c91ae6d24d8f1b147554ce5ee9c2aba..6000c20ba1bd02f7da78b85c6843fb9d3592936c 100644 (file)
 use std::{ebml, map};
 use std::map::HashMap;
 use io::WriterUtil;
-use writer = ebml::writer;
+use writer = std::ebml::writer;
 use syntax::ast::*;
 use syntax::print::pprust;
 use syntax::{ast_util, visit};
 use syntax::ast_util::*;
-use common::*;
+use metadata::common::*;
 use middle::ty;
 use middle::ty::node_id_to_type;
 use middle::resolve;
index b1a4fcc24cd5481940ae506bf36d56cee3916493..5901e58aeb190afb78116c30366397d0ad4d3c2d 100644 (file)
@@ -15,7 +15,7 @@
 use syntax::print::pprust;
 use syntax::codemap::span;
 use lib::llvm::{False, llvm, mk_object_file, mk_section_iter};
-use filesearch::FileSearch;
+use metadata::filesearch::FileSearch;
 use io::WriterUtil;
 use syntax::parse::token::ident_interner;
 
index 437900021368ee3109ff6c3c97240c280a55342c..4ba6abb03831093ee8fc40895c562d13cfb2b25b 100644 (file)
 #[legacy_exports]
 mod filesearch;
 
-
-// Define the rustc API's that the metadata module has access to
-// Over time we will reduce these dependencies and, once metadata has
-// no dependencies on rustc it can move into its own crate.
-
-mod middle {
-    #[legacy_exports];
-    pub use middle_::ty;
-    pub use middle_::resolve;
-}
-
-mod front {
-    #[legacy_exports];
-}
-
-mod back {
-    #[legacy_exports];
-}
-
-mod driver {
-    #[legacy_exports];
-}
-
-mod util {
-    #[legacy_exports];
-    pub use util_::ppaux;
-}
-
-mod lib {
-    #[legacy_exports];
-    pub use lib_::llvm;
-}
index 1708027eaf9b8c68bb2d46c4b46d0e2f919aa760..9289e17eeb2db0a5dfedaab55d89fcfde775aea4 100644 (file)
 // tjc note: Would be great to have a `match check` macro equivalent
 // for some of these
 
+use middle::ty;
+use middle::ty::{FnTyBase, FnMeta, FnSig};
+
 use syntax::ast;
 use syntax::ast::*;
 use syntax::ast_util;
 use syntax::ast_util::respan;
-use middle::ty;
 use std::map::HashMap;
-use ty::{FnTyBase, FnMeta, FnSig};
 
 export parse_state_from_data;
 export parse_arg_data, parse_ty_data, parse_def_id, parse_ident;
index 781ac7809e70cf5904fbe6e05e44fa7bee4d9d34..cf6b0bf332e413dbccf91e72e75924092f0aeffb 100644 (file)
@@ -8,46 +8,40 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use c = metadata::common;
+use cstore = metadata::cstore;
+use driver::session::Session;
+use e = metadata::encoder;
+use metadata::decoder;
+use metadata::encoder;
+use metadata::tydecode;
+use metadata::tyencode;
+use middle::freevars::freevar_entry;
+use middle::typeck::{method_origin, method_map_entry, vtable_res};
+use middle::typeck::{vtable_origin};
+use middle::{ty, typeck};
 use util::ppaux::ty_to_str;
 
+use reader = std::ebml::reader;
+use std::ebml::reader::get_doc;
+use std::ebml::writer::Serializer;
+use std::ebml;
+use std::map::HashMap;
+use std::serialization::{DeserializerHelpers, deserialize};
+use std::serialization::{Serializable, SerializerHelpers};
+use std::serialization;
 use syntax::ast;
-use syntax::fold;
-use syntax::fold::*;
-use syntax::visit;
 use syntax::ast_map;
 use syntax::ast_util;
 use syntax::codemap::span;
-use std::ebml;
-use writer = std::ebml::writer;
-use reader = std::ebml::reader;
-use reader::get_doc;
-use writer::Serializer;
-use std::map::HashMap;
-use std::serialization;
-use std::serialization::{Serializable,
-                         SerializerHelpers,
-                         DeserializerHelpers,
-                         deserialize};
-use middle::{ty, typeck};
-use middle::typeck::{method_origin, method_map_entry,
-                     vtable_res,
-                     vtable_origin};
-use driver::session::Session;
-use middle::freevars::freevar_entry;
-use c = metadata::common;
-use e = metadata::encoder;
-use cstore = metadata::cstore;
-use metadata::encoder;
-use metadata::decoder;
-use metadata::tyencode;
-use metadata::tydecode;
-
-
-// used in testing:
-use syntax::diagnostic;
 use syntax::codemap;
+use syntax::diagnostic;
+use syntax::fold::*;
+use syntax::fold;
 use syntax::parse;
 use syntax::print::pprust;
+use syntax::visit;
+use writer = std::ebml::writer;
 
 export maps;
 export encode_inlined_item;
index eafbe8b16abcf1a8a41501105f3b5e15800447cf..d5809a7389e811770a9ba413f2164c3354e94af1 100644 (file)
@@ -16,9 +16,9 @@
 // their associated scopes.  In phase two, checking loans, we will then make
 // sure that all of these loans are honored.
 
-use mem_categorization::{mem_categorization_ctxt, opt_deref_kind};
-use preserve::{preserve_condition, pc_ok, pc_if_pure};
-use ty::{ty_region};
+use middle::mem_categorization::{mem_categorization_ctxt, opt_deref_kind};
+use middle::borrowck::preserve::{preserve_condition, pc_ok, pc_if_pure};
+use middle::ty::{ty_region};
 
 use core::send_map::linear::LinearMap;
 
index c5a02c978f96a67089e7ee1709fe5f2adbe37a68..90de32814470ee8e83216066d34c1bcd26ac3b9e 100644 (file)
 
 #[legacy_exports];
 
-use syntax::ast;
+use middle::mem_categorization::*;
+use middle::ty::to_str;
+use util::common::indenter;
+use util::ppaux::{expr_repr, note_and_explain_region};
+use util::ppaux::{ty_to_str, region_to_str, explain_region};
+
+use core::dvec::DVec;
+use core::result::{Result, Ok, Err};
+use std::list::{List, Cons, Nil};
+use std::list;
+use std::map::{HashMap, Set};
 use syntax::ast::{mutability, m_mutbl, m_imm, m_const};
-use syntax::visit;
-use syntax::ast_util;
+use syntax::ast;
 use syntax::ast_map;
+use syntax::ast_util;
 use syntax::codemap::span;
-use util::ppaux::{ty_to_str, region_to_str, explain_region,
-                  expr_repr, note_and_explain_region};
-use std::map::{HashMap, Set};
-use std::list;
-use std::list::{List, Cons, Nil};
-use result::{Result, Ok, Err};
 use syntax::print::pprust;
-use util::common::indenter;
-use ty::to_str;
-use dvec::DVec;
-use mem_categorization::*;
+use syntax::visit;
 
 #[legacy_exports]
-mod check_loans;
+pub mod check_loans;
 #[legacy_exports]
-mod gather_loans;
+pub mod gather_loans;
 #[legacy_exports]
-mod loan;
+pub mod loan;
 #[legacy_exports]
-mod preserve;
+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,
index ff4fed8b37eed9107086a5af8e842b5d292d4a65..d3448a5f3a9bc877357727ce6595cf3a06271e3a 100644 (file)
@@ -8,19 +8,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use middle::const_eval::{compare_const_vals, lookup_const_by_id};
+use middle::const_eval::{eval_const_expr, const_val, const_int, const_bool};
+use middle::pat_util::*;
+use middle::ty::*;
+use middle::ty;
+use middle::typeck::method_map;
+use util::ppaux::ty_to_str;
+
+use std::map::HashMap;
 use syntax::ast::*;
 use syntax::ast_util::{variant_def_ids, dummy_sp, unguarded_pat, walk_pat};
-use const_eval::{eval_const_expr, const_val, const_int, const_bool,
-                 compare_const_vals, lookup_const_by_id};
 use syntax::codemap::span;
 use syntax::print::pprust::pat_to_str;
-use util::ppaux::ty_to_str;
-use pat_util::*;
 use syntax::visit;
-use middle::ty;
-use middle::ty::*;
-use middle::typeck::method_map;
-use std::map::HashMap;
 
 struct AltCheckCtxt {
     tcx: ty::ctxt,
index f483f922ed7acca36ef17a0c15a5f326377ce889..a51885b1fc7eb35e72128605ca6c505cb66aa28e 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use syntax::{ast,ast_map,ast_util,visit};
-use ast::*;
+use syntax::{ast, ast_map, ast_util, visit};
+use syntax::ast::*;
 
 //
 // This pass classifies expressions by their constant-ness.
index f5edad9acc4325784effb823526f757a77718518..a8395013958eb3c71e904518f0c62c0796c77630 100644 (file)
@@ -8,16 +8,17 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use syntax::{visit, ast_util};
-use syntax::ast::*;
-use syntax::codemap::span;
-use middle::ty::{Kind, kind_copyable, kind_noncopyable, kind_const};
+use middle::freevars::freevar_entry;
+use middle::lint::{non_implicitly_copyable_typarams, implicit_copies};
 use middle::ty::{CopyValue, MoveValue, ReadValue};
-use std::map::HashMap;
+use middle::ty::{Kind, kind_copyable, kind_noncopyable, kind_const};
 use util::ppaux::{ty_to_str, tys_to_str};
+
+use std::map::HashMap;
+use syntax::ast::*;
+use syntax::codemap::span;
 use syntax::print::pprust::expr_to_str;
-use freevars::freevar_entry;
-use lint::{non_implicitly_copyable_typarams,implicit_copies};
+use syntax::{visit, ast_util};
 
 // Kind analysis pass.
 //
index e8fcbf123562cacfe303ffb8039532ef54643ea1..48fff1a269bde792cbf09af1f847f40000b4efb6 100644 (file)
  *   to return explicitly.
  */
 
-use dvec::DVec;
+use middle::capture::{cap_move, cap_drop, cap_copy, cap_ref};
+use middle::ty::MoveValue;
+
+use core::dvec::DVec;
+use core::io::WriterUtil;
 use std::map::HashMap;
-use syntax::{visit, ast_util};
-use syntax::print::pprust::{expr_to_str, block_to_str};
-use visit::vt;
-use syntax::codemap::span;
 use syntax::ast::*;
-use io::WriterUtil;
-use capture::{cap_move, cap_drop, cap_copy, cap_ref};
-use middle::ty::MoveValue;
+use syntax::codemap::span;
+use syntax::print::pprust::{expr_to_str, block_to_str};
+use syntax::visit::vt;
+use syntax::{visit, ast_util};
 
 export check_crate;
 export last_use_map;
index 78c423b791d57727ac11689c5e444fe15077f9d0..5819db17f58a842eea6a82224ff5ae68040746b2 100644 (file)
@@ -11,6 +11,9 @@
 // A pass that checks to make sure private fields and methods aren't used
 // outside their scopes.
 
+use middle::ty::{ty_struct, ty_enum};
+use middle::typeck::{method_map, method_origin, method_param, method_self};
+use middle::typeck::{method_static, method_trait};
 use /*mod*/ syntax::ast;
 use /*mod*/ syntax::visit;
 use syntax::ast_map;
@@ -21,9 +24,6 @@
 use syntax::ast_map::{node_item, node_method};
 use syntax::ast_util::{Private, Public, has_legacy_export_attr, is_local};
 use syntax::ast_util::{visibility_to_privacy};
-use ty::{ty_struct, ty_enum};
-use typeck::{method_map, method_origin, method_param, method_self};
-use typeck::{method_static, method_trait};
 
 use core::util::ignore;
 use dvec::DVec;
index 4d5e29678a184fb6cf5e49630daaa080084b1b9a..f746e0236807ed3daa6f980a25768d027a70fd4b 100644 (file)
 */
 
 use driver::session::Session;
-use middle::ty;
-use syntax::{ast, visit};
-use syntax::codemap::span;
-use syntax::print::pprust;
-use syntax::ast_map;
-use dvec::DVec;
 use metadata::csearch;
-use ty::{region_variance, rv_covariant, rv_invariant, rv_contravariant};
+use middle::ty::{region_variance, rv_covariant, rv_invariant};
+use middle::ty::{rv_contravariant};
+use middle::ty;
 
+use core::dvec::DVec;
 use std::list;
 use std::list::list;
 use std::map::HashMap;
+use syntax::ast_map;
+use syntax::codemap::span;
+use syntax::print::pprust;
+use syntax::{ast, visit};
 
 type parent = Option<ast::node_id>;
 
index bc987db48cd66ac40c284b534cf93c71c007d1f2..bc728e5319a33c79eeac6151f42301bf92f6270b 100644 (file)
@@ -313,6 +313,16 @@ enum XrayFlag {
     Xray        //< Private items can be accessed.
 }
 
+enum UseLexicalScopeFlag {
+    DontUseLexicalScope,
+    UseLexicalScope
+}
+
+struct ModulePrefixResult {
+    result: ResolveResult<@Module>,
+    prefix_len: uint
+}
+
 impl XrayFlag : cmp::Eq {
     pure fn eq(&self, other: &XrayFlag) -> bool {
         ((*self) as uint) == ((*other) as uint)
@@ -2108,9 +2118,10 @@ fn resolve_import_for_module(module_: @Module,
         } else {
             // First, resolve the module path for the directive, if necessary.
             match self.resolve_module_path_for_import(module_,
-                                                    module_path,
-                                                    NoXray,
-                                                    import_directive.span) {
+                                                      module_path,
+                                                      NoXray,
+                                                      DontUseLexicalScope,
+                                                      import_directive.span) {
 
                 Failed => {
                     resolution_result = Failed;
@@ -2650,8 +2661,11 @@ fn resolve_module_path_from_root(module_: @Module,
 
         while index < module_path_len {
             let name = (*module_path).get_elt(index);
-            match self.resolve_name_in_module(search_module, name, TypeNS,
-                                              xray) {
+            match self.resolve_name_in_module(search_module,
+                                              name,
+                                              TypeNS,
+                                              xray,
+                                              false) {
                 Failed => {
                     self.session.span_err(span, ~"unresolved name");
                     return Failed;
@@ -2702,12 +2716,13 @@ fn resolve_module_path_from_root(module_: @Module,
     }
 
     /**
-     * Attempts to resolve the module part of an import directive 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(module_: @Module,
                                       module_path: @DVec<ident>,
                                       xray: XrayFlag,
+                                      use_lexical_scope: UseLexicalScopeFlag,
                                       span: span)
                                    -> ResolveResult<@Module> {
 
@@ -2722,9 +2737,20 @@ fn resolve_module_path_for_import(module_: @Module,
         // The first element of the module path must be in the current scope
         // chain.
 
-        let first_element = (*module_path).get_elt(0);
+        let resolve_result = match use_lexical_scope {
+            DontUseLexicalScope => {
+                self.resolve_module_prefix(module_, module_path)
+            }
+            UseLexicalScope => {
+                let result = self.resolve_module_in_lexical_scope(
+                    module_,
+                    module_path.get_elt(0));
+                ModulePrefixResult { result: result, prefix_len: 1 }
+            }
+        };
+
         let mut search_module;
-        match self.resolve_module_in_lexical_scope(module_, first_element) {
+        match resolve_result.result {
             Failed => {
                 self.session.span_err(span, ~"unresolved name");
                 return Failed;
@@ -2740,10 +2766,10 @@ fn resolve_module_path_for_import(module_: @Module,
         }
 
         return self.resolve_module_path_from_root(search_module,
-                                               module_path,
-                                               1,
-                                               xray,
-                                               span);
+                                                  module_path,
+                                                  resolve_result.prefix_len,
+                                                  xray,
+                                                  span);
     }
 
     fn resolve_item_in_lexical_scope(module_: @Module,
@@ -2811,8 +2837,11 @@ fn resolve_item_in_lexical_scope(module_: @Module,
             }
 
             // Resolve the name in the parent module.
-            match self.resolve_name_in_module(search_module, name, namespace,
-                                            Xray) {
+            match self.resolve_name_in_module(search_module,
+                                              name,
+                                              namespace,
+                                              Xray,
+                                              false) {
                 Failed => {
                     // Continue up the search chain.
                 }
@@ -2832,9 +2861,15 @@ fn resolve_item_in_lexical_scope(module_: @Module,
         }
     }
 
+    /** Resolves a module name in the current lexical scope. */
     fn resolve_module_in_lexical_scope(module_: @Module, name: ident)
                                     -> ResolveResult<@Module> {
-        match self.resolve_item_in_lexical_scope(module_, name, TypeNS) {
+        // If this module is an anonymous module, resolve the item in the
+        // lexical scope. Otherwise, resolve the item from the crate root.
+        let resolve_result = self.resolve_item_in_lexical_scope(module_,
+                                                                name,
+                                                                TypeNS);
+        match resolve_result {
             Success(target) => {
                 match target.bindings.type_def {
                     Some(ref type_def) => {
@@ -2870,6 +2905,102 @@ fn resolve_module_in_lexical_scope(module_: @Module, name: ident)
         }
     }
 
+    /**
+     * Resolves a "module prefix". A module prefix is one of (a) the name of a
+     * module; (b) "self::"; (c) some chain of "super::".
+     */
+    fn resolve_module_prefix(module_: @Module,
+                             module_path: @DVec<ident>)
+                          -> ModulePrefixResult {
+        let interner = self.session.parse_sess.interner;
+
+        let mut containing_module = self.graph_root.get_module();
+        let mut i = 0;
+        loop {
+            if *interner.get(module_path.get_elt(i)) == ~"self" {
+                containing_module = module_;
+                i += 1;
+                break;
+            }
+            if *interner.get(module_path.get_elt(i)) == ~"super" {
+                match containing_module.parent_link {
+                    NoParentLink => {
+                        return ModulePrefixResult {
+                            result: Failed,
+                            prefix_len: i
+                        };
+                    }
+                    BlockParentLink(new_module, _) |
+                    ModuleParentLink(new_module, _) => {
+                        containing_module = new_module;
+                    }
+                }
+                i += 1;
+            } else {
+                break;
+            }
+        }
+
+        // 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);
+        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 + 1
+                                };
+                            }
+                            Some(module_def) => {
+                                return ModulePrefixResult {
+                                    result: Success(module_def),
+                                    prefix_len: i + 1
+                                };
+                            }
+                        }
+                    }
+                    None => {
+                        error!("!!! (resolving crate-relative module) module
+                                wasn't actually a module!");
+                        return ModulePrefixResult {
+                            result: Failed,
+                            prefix_len: i + 1
+                        };
+                    }
+                }
+            }
+            Indeterminate => {
+                debug!("(resolving crate-relative module) indeterminate; \
+                        bailing");
+                return ModulePrefixResult {
+                    result: Indeterminate,
+                    prefix_len: i + 1
+                };
+            }
+            Failed => {
+                debug!("(resolving crate-relative module) failed to resolve");
+                return ModulePrefixResult {
+                    result: Failed,
+                    prefix_len: i + 1
+                };
+            }
+        }
+    }
+
     fn name_is_exported(module_: @Module, name: ident) -> bool {
         return !module_.legacy_exports ||
             module_.exported_names.size() == 0 ||
@@ -2884,7 +3015,8 @@ fn name_is_exported(module_: @Module, name: ident) -> bool {
     fn resolve_name_in_module(module_: @Module,
                               name: ident,
                               namespace: Namespace,
-                              xray: XrayFlag)
+                              xray: XrayFlag,
+                              allow_globs: bool)
                            -> ResolveResult<Target> {
 
         debug!("(resolving name in module) resolving `%s` in `%s`",
@@ -2910,10 +3042,10 @@ fn resolve_name_in_module(module_: @Module,
             }
         }
 
-        // Next, check the module's imports. If the module has a glob, then
-        // we bail out; we don't know its imports yet.
-
-        if module_.glob_count > 0 {
+        // 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;
         }
@@ -4627,10 +4759,10 @@ fn resolve_module_relative_path(path: @path,
 
         let mut containing_module;
         match self.resolve_module_path_for_import(self.current_module,
-                                                module_path_idents,
-                                                xray,
-                                                path.span) {
-
+                                                  module_path_idents,
+                                                  xray,
+                                                  UseLexicalScope,
+                                                  path.span) {
             Failed => {
                 self.session.span_err(path.span,
                                       fmt!("use of undeclared module `%s`",
index 5d5b578355607391f793801299100119c103a342..7885a8ea0b60111fba93dbfb1d3bd2d07d673011 100644 (file)
  *
  */
 
+use back::abi;
 use lib::llvm::llvm;
 use lib::llvm::{ValueRef, BasicBlockRef};
-use pat_util::*;
-use build::*;
-use base::*;
+use middle::pat_util::*;
+use middle::resolve::DefMap;
+use middle::trans::base::*;
+use middle::trans::build::*;
+use middle::trans::common::*;
+use middle::trans::datum::*;
+use middle::trans::expr::Dest;
+use middle::ty::{CopyValue, MoveValue, ReadValue};
+use util::common::indenter;
+
+use core::dvec::DVec;
+use std::map::HashMap;
+use syntax::ast::def_id;
 use syntax::ast;
-use syntax::ast_util;
 use syntax::ast_util::{dummy_sp, path_to_ident};
-use syntax::ast::def_id;
+use syntax::ast_util;
 use syntax::codemap::span;
 use syntax::print::pprust::pat_to_str;
-use middle::resolve::DefMap;
-use middle::ty::{CopyValue, MoveValue, ReadValue};
-use back::abi;
-use std::map::HashMap;
-use dvec::DVec;
-use datum::*;
-use common::*;
-use expr::Dest;
-use util::common::indenter;
 
 fn macros() { include!("macros.rs"); } // FIXME(#3114): Macro import/export.
 
index cf6207dee588a4d4cd39415b7cb2f92559c13519..a65f6668cd3582abcb5160be569fd489eec2074b 100644 (file)
 //     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 libc::{c_uint, c_ulonglong};
-use std::{map, time, list};
-use std::map::HashMap;
-use driver::session;
-use session::Session;
-use syntax::attr;
+use back::link::{mangle_exported_name};
+use back::link::{mangle_internal_name_by_path_and_seq};
+use back::link::{mangle_internal_name_by_path};
+use back::link::{mangle_internal_name_by_seq};
+use back::link::{mangle_internal_name_by_type_only};
 use back::{link, abi, upcall};
-use syntax::{ast, ast_util, codemap, ast_map};
-use ast_util::{def_id_of_def, local_def, path_to_ident};
-use syntax::visit;
-use syntax::codemap::span;
-use syntax::print::pprust::{expr_to_str, stmt_to_str, path_to_str};
-use pat_util::*;
-use visit::vt;
-use util::common::is_main_name;
-use lib::llvm::{llvm, mk_target_data, mk_type_names};
+use driver::session;
+use driver::session::Session;
 use lib::llvm::{ModuleRef, ValueRef, TypeRef, BasicBlockRef};
 use lib::llvm::{True, False};
-use link::{mangle_internal_name_by_type_only,
-              mangle_internal_name_by_seq,
-              mangle_internal_name_by_path,
-              mangle_internal_name_by_path_and_seq,
-              mangle_exported_name};
-use metadata::{csearch, cstore, decoder, encoder};
+use lib::llvm::{llvm, mk_target_data, mk_type_names};
 use metadata::common::link_meta;
-use util::ppaux;
-use util::ppaux::{ty_to_str, ty_to_short_str};
-use syntax::diagnostic::expect;
+use metadata::{csearch, cstore, decoder, encoder};
+use middle::pat_util::*;
+use middle::trans::build::*;
+use middle::trans::common::*;
+use middle::trans::shape::*;
+use middle::trans::type_of::*;
 use util::common::indenter;
+use util::common::is_main_name;
+use util::ppaux::{ty_to_str, ty_to_short_str};
+use util::ppaux;
 
-use build::*;
-use shape::*;
-use type_of::*;
-use common::*;
+use core::libc::{c_uint, c_ulonglong};
+use core::option::{is_none, is_some};
+use std::map::HashMap;
+use std::smallintmap;
+use std::{map, time, list};
 use syntax::ast_map::{path, path_mod, path_name};
+use syntax::ast_util::{def_id_of_def, local_def, path_to_ident};
+use syntax::attr;
+use syntax::codemap::span;
+use syntax::diagnostic::expect;
 use syntax::parse::token::special_idents;
-
-use std::smallintmap;
-use option::{is_none, is_some};
+use syntax::print::pprust::{expr_to_str, stmt_to_str, path_to_str};
+use syntax::visit;
+use syntax::visit::vt;
+use syntax::{ast, ast_util, codemap, ast_map};
 
 struct icx_popper {
     ccx: @crate_ctxt,
@@ -1228,7 +1227,7 @@ fn with_scope_datumblock(bcx: block, opt_node_info: Option<node_info>,
                          name: ~str, f: fn(block) -> datum::DatumBlock)
     -> datum::DatumBlock
 {
-    use datum::DatumBlock;
+    use middle::trans::datum::DatumBlock;
 
     let _icx = bcx.insn_ctxt("with_scope_result");
     let scope_cx = scope_block(bcx, opt_node_info, name);
index acb7fac19f800eaa166322b3beedad4e082759ce..614a02a9700529906fa535f61fe63598b881a271 100644 (file)
@@ -8,15 +8,16 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::map::HashMap;
-use libc::{c_uint, c_int};
-use lib::llvm::llvm;
-use syntax::codemap;
 use codemap::span;
+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 lib::llvm::{Opcode, IntPredicate, RealPredicate, True, False,
-        CallConv, TypeKind, AtomicBinOp, AtomicOrdering};
-use common::*;
+use libc::{c_uint, c_int};
+use middle::trans::common::*;
+
+use std::map::HashMap;
+use syntax::codemap;
 
 fn B(cx: block) -> BuilderRef {
     let b = cx.fcx.ccx.builder.B;
index 50bf0cf39c889a59e03dcf23293bd7f5027c7abb..7117ae6910cc27271e6e4a2166f6c4833911e3e0 100644 (file)
 // closure.
 
 use lib::llvm::ValueRef;
+use middle::trans::base::{get_item_val, trans_external_path};
+use middle::trans::build::*;
+use middle::trans::common::{block, node_id_type_params};
+use middle::trans::datum::*;
+use middle::trans::datum::Datum;
+use util::common::indenter;
+
 use syntax::ast;
-use datum::Datum;
-use common::{block, node_id_type_params};
-use build::*;
-use base::{get_item_val, trans_external_path};
-use syntax::visit;
 use syntax::print::pprust::{expr_to_str, stmt_to_str, path_to_str};
-use datum::*;
-use util::common::indenter;
+use syntax::visit;
 
 // Represents a (possibly monomorphized) top-level fn item or method
 // item.  Note that this is just the fn-ptr and is not a Rust closure
index 2796cca68388f2f76a6f7a476b3372972d3e21f9..5110bc261f7a987f1f9b954a6c09b39d529538db 100644 (file)
@@ -8,26 +8,25 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use libc::c_uint;
-use syntax::ast;
-use syntax::ast_util;
+use back::abi;
+use back::link::{mangle_internal_name_by_path_and_seq};
+use back::link::{mangle_internal_name_by_path};
 use lib::llvm::llvm;
 use lib::llvm::{ValueRef, TypeRef};
-use common::*;
-use build::*;
-use base::*;
-use type_of::*;
-use back::abi;
-use syntax::codemap::span;
-use syntax::print::pprust::expr_to_str;
-use back::link::{
-    mangle_internal_name_by_path,
-    mangle_internal_name_by_path_and_seq};
+use middle::trans::base::*;
+use middle::trans::build::*;
+use middle::trans::common::*;
+use middle::trans::datum::{Datum, INIT, ByRef, ByValue, FromLvalue};
+use middle::trans::type_of::*;
 use util::ppaux::ty_to_str;
-use syntax::ast_map::{path, path_mod, path_name};
-use driver::session::session;
+
+use core::libc::c_uint;
 use std::map::HashMap;
-use datum::{Datum, INIT, ByRef, ByValue, FromLvalue};
+use syntax::ast;
+use syntax::ast_map::{path, path_mod, path_name};
+use syntax::ast_util;
+use syntax::codemap::span;
+use syntax::print::pprust::expr_to_str;
 
 // ___Good to know (tm)__________________________________________________
 //
index d1b5ece9b0ce60ce371d14662a2d1723a0e21635..355e78014805dc9343d0540353adbdf5fb037989 100644 (file)
@@ -8,9 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use common::*;
+use middle::trans::base::get_insn_ctxt;
+use middle::trans::common::*;
+
 use syntax::{ast, ast_util, codemap, ast_map};
-use base::get_insn_ctxt;
 
 fn const_lit(cx: @crate_ctxt, e: @ast::expr, lit: ast::lit)
     -> ValueRef {
index e7d3c8a207c4ee233929af63402f89fd96ca6fcb..2a9cece231b7359b377148a15ebfe5e179b5dd18 100644 (file)
@@ -9,9 +9,9 @@
 // except according to those terms.
 
 use lib::llvm::ValueRef;
-use common::*;
-use datum::*;
-use base::*;
+use middle::trans::base::*;
+use middle::trans::common::*;
+use middle::trans::datum::*;
 
 fn macros() { include!("macros.rs"); } // FIXME(#3114): Macro import/export.
 
index 5fc6a9ed0ba6fe50c219344bad055032f6586308..e303b3611c577dc4d206d222a54eb1d826ca2e71 100644 (file)
  * values. */
 
 use lib::llvm::ValueRef;
-use base::*;
-use common::*;
-use build::*;
-use util::ppaux::ty_to_str;
+use middle::trans::base::*;
+use middle::trans::build::*;
+use middle::trans::common::*;
 use util::common::indenter;
+use util::ppaux::ty_to_str;
 
 enum CopyAction {
     INIT,
index e201493ca2b83985c500e6d8efbc881e07025649..b255b47bab30bac3297a746fd920456b6e664ce4 100644 (file)
@@ -8,21 +8,22 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::map;
-use std::map::HashMap;
-use lib::llvm::llvm;
+use driver::session;
 use lib::llvm::ValueRef;
-use trans::common::*;
-use trans::base;
-use trans::build::B;
+use lib::llvm::llvm;
+use middle::pat_util::*;
+use middle::trans::base;
+use middle::trans::build::B;
+use middle::trans::common::*;
 use middle::ty;
-use syntax::{ast, codemap, ast_util, ast_map};
-use syntax::parse::token::ident_interner;
-use codemap::{span, CharPos};
-use ast::Ty;
-use pat_util::*;
 use util::ppaux::ty_to_str;
-use driver::session::session;
+
+use std::map::HashMap;
+use std::map;
+use syntax::ast::Ty;
+use syntax::codemap::{span, CharPos};
+use syntax::parse::token::ident_interner;
+use syntax::{ast, codemap, ast_util, ast_map};
 
 export create_local_var;
 export create_function;
index 59a1206bd0d027c97dacde0c7caf22993c1613ac..764ddabd1434f38a68b9c995354f3a5e66c897c5 100644 (file)
 
 */
 
-use ty::struct_mutable_fields;
 use lib::llvm::ValueRef;
-use common::*;
-use datum::*;
-use base::*;
-use syntax::print::pprust::{expr_to_str};
-use util::ppaux::ty_to_str;
-use util::common::indenter;
-use ty::{AutoPtr, AutoBorrowVec, AutoBorrowVecRef, AutoBorrowFn};
-use callee::{AutorefArg, DoAutorefArg, DontAutorefArg};
+use middle::trans::base::*;
+use middle::trans::callee::{AutorefArg, DoAutorefArg, DontAutorefArg};
+use middle::trans::common::*;
+use middle::trans::datum::*;
 use middle::ty::MoveValue;
+use middle::ty::struct_mutable_fields;
+use middle::ty::{AutoPtr, AutoBorrowVec, AutoBorrowVecRef, AutoBorrowFn};
+use util::common::indenter;
+use util::ppaux::ty_to_str;
+
+use syntax::print::pprust::{expr_to_str};
 
 // The primary two functions for translating expressions:
 export trans_to_datum, trans_into;
index bef7d01e8194761f91cad723c3b9e1854041b5fd..38c3a4f7cb3589516e29749cf4e7ca96dbcefacb 100644 (file)
 // 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 back::{link, abi};
 use driver::session::arch_x86_64;
+use lib::llvm::{SequentiallyConsistent, Acquire, Release, Xchg};
+use lib::llvm::{Struct, Array, ModuleRef, CallConv, Attribute};
+use lib::llvm::{StructRetAttribute, ByValAttribute};
+use lib::llvm::{llvm, TypeRef, ValueRef, Integer, Pointer, Float, Double};
+use middle::trans::base::*;
+use middle::trans::build::*;
+use middle::trans::callee::*;
+use middle::trans::common::*;
+use middle::trans::datum::*;
+use middle::trans::expr::{Dest, Ignore};
+use middle::trans::type_of::*;
+use middle::ty::{FnTyBase, FnMeta, FnSig};
+use util::ppaux::ty_to_str;
+
+use core::libc::c_uint;
+use std::map::HashMap;
 use syntax::codemap::span;
-use libc::c_uint;
-use syntax::{attr, ast_map};
-use lib::llvm::{ llvm, TypeRef, ValueRef, Integer, Pointer, Float, Double,
-    Struct, Array, ModuleRef, CallConv, Attribute,
-    StructRetAttribute, ByValAttribute,
-    SequentiallyConsistent, Acquire, Release, Xchg };
 use syntax::{ast, ast_util};
-use back::{link, abi};
-use common::*;
-use build::*;
-use base::*;
-use type_of::*;
-use std::map::HashMap;
-use util::ppaux::ty_to_str;
-use datum::*;
-use callee::*;
-use expr::{Dest, Ignore};
-use ty::{FnTyBase, FnMeta, FnSig};
+use syntax::{attr, ast_map};
 
 export link_name, trans_foreign_mod, register_foreign_fn, trans_foreign_fn,
        trans_intrinsic;
index 647ed2275b5e1e538d2014e322562a9cd5d1c645..a42dee615e4b5e3deed3f2dca21457938a666144 100644 (file)
 // Code relating to taking, dropping, etc as well as type descriptors.
 
 use lib::llvm::{ValueRef, TypeRef};
-use base::*;
-use common::*;
-use build::*;
-use type_of::type_of;
+use middle::trans::base::*;
+use middle::trans::common::*;
+use middle::trans::build::*;
+use middle::trans::type_of::type_of;
 
 fn trans_free(cx: block, v: ValueRef) -> block {
     let _icx = cx.insn_ctxt("trans_free");
index f65ac09227596affa5b2556518370e66e7952b1e..6f5aa792c4748546a8b4cde12c916d06153fc8a8 100644 (file)
@@ -8,12 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use common::*;
+use middle::trans::base::{get_insn_ctxt};
+use middle::trans::base::{impl_owned_self, impl_self, no_self};
+use middle::trans::base::{trans_item, get_item_val, self_arg, trans_fn};
+use middle::trans::common::*;
+
 use syntax::ast;
-use syntax::ast_util::local_def;
 use syntax::ast_map::{path, path_mod, path_name};
-use base::{trans_item, get_item_val, self_arg, trans_fn, impl_owned_self,
-           impl_self, no_self, get_insn_ctxt};
+use syntax::ast_util::local_def;
 
 // `translate` will be true if this function is allowed to translate the
 // item and false otherwise. Currently, this parameter is set to false when
index d214208560419b94b005979dda23080a5ff186af..0488ed1e5b3da68b85d100683101721008e1a3ef 100644 (file)
@@ -8,25 +8,25 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use libc::c_uint;
-use base::*;
-use common::*;
-use type_of::*;
-use build::*;
-use driver::session::{session, expect};
-use syntax::{ast, ast_map};
-use ast_map::{path, path_mod, path_name, node_id_to_str};
-use syntax::ast_util::local_def;
-use metadata::csearch;
 use back::{link, abi};
+use lib::llvm::llvm::LLVMGetParam;
 use lib::llvm::llvm;
 use lib::llvm::{ValueRef, TypeRef};
-use lib::llvm::llvm::LLVMGetParam;
-use std::map::HashMap;
+use metadata::csearch;
+use middle::trans::base::*;
+use middle::trans::build::*;
+use middle::trans::callee::*;
+use middle::trans::common::*;
+use middle::trans::expr::{SaveIn, Ignore};
+use middle::trans::type_of::*;
 use util::ppaux::{ty_to_str, tys_to_str};
-use callee::*;
+
+use core::libc::c_uint;
+use std::map::HashMap;
+use syntax::ast_map::{path, path_mod, path_name, node_id_to_str};
+use syntax::ast_util::local_def;
 use syntax::print::pprust::expr_to_str;
-use expr::{SaveIn, Ignore};
+use syntax::{ast, ast_map};
 
 fn macros() { include!("macros.rs"); } // FIXME(#3114): Macro import/export.
 
index c5a93ecd89d3c7b374b8e20c7bcafee1ac5cc6e4..9d662f875510cb2172a5fad160ae3d9cb27d5986 100644 (file)
@@ -8,19 +8,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use common::*;
+use back::link::mangle_exported_name;
+use middle::trans::base::{get_insn_ctxt};
+use middle::trans::base::{set_inline_hint_if_appr, set_inline_hint};
+use middle::trans::base::{trans_enum_variant, trans_struct_dtor};
+use middle::trans::base::{trans_fn, impl_self, decl_internal_cdecl_fn};
+use middle::trans::base::{trans_item, get_item_val, no_self, self_arg};
+use middle::trans::common::*;
+use middle::trans::type_of::type_of_fn_from_ty;
+use middle::ty::{FnTyBase, FnMeta, FnSig};
+
 use syntax::ast;
-use syntax::ast_util::local_def;
 use syntax::ast_map::{path, path_mod, path_name};
-use base::{trans_item, get_item_val, no_self, self_arg, trans_fn,
-              impl_self, decl_internal_cdecl_fn,
-              set_inline_hint_if_appr, set_inline_hint,
-              trans_enum_variant, trans_struct_dtor,
-              get_insn_ctxt};
+use syntax::ast_util::local_def;
 use syntax::parse::token::special_idents;
-use type_of::type_of_fn_from_ty;
-use back::link::mangle_exported_name;
-use middle::ty::{FnTyBase, FnMeta, FnSig};
 
 fn monomorphic_fn(ccx: @crate_ctxt,
                   fn_id: ast::def_id,
index bc85a57a64bb4958be52f43a27ef7abb12d4bf39..d15a9c101b9555e169c77502712d47aa56bfacc6 100644 (file)
@@ -8,19 +8,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::map::HashMap;
-use lib::llvm::{TypeRef, ValueRef};
-use syntax::ast;
 use back::abi;
-use common::*;
-use build::*;
-use base::*;
-use type_of::*;
-use ast::def_id;
+use lib::llvm::{TypeRef, ValueRef};
+use middle::trans::base::*;
+use middle::trans::build::*;
+use middle::trans::callee::{ArgVals, DontAutorefArg};
+use middle::trans::common::*;
+use middle::trans::datum::*;
+use middle::trans::expr::SaveIn;
+use middle::trans::type_of::*;
 use util::ppaux::ty_to_str;
-use datum::*;
-use callee::{ArgVals, DontAutorefArg};
-use expr::SaveIn;
+
+use std::map::HashMap;
+use syntax::ast::def_id;
+use syntax::ast;
 
 enum reflector = {
     visitor_val: ValueRef,
index a95e25d625f7fa36a12713a5c3fe3cb1cb4ac647..51c3cb9362f399972c862683fc8ab5a9a3930a3a 100644 (file)
 // A "shape" is a compact encoding of a type that is used by interpreted glue.
 // This substitutes for the runtime tags used by e.g. MLs.
 
+use back::abi;
 use lib::llvm::llvm;
 use lib::llvm::{True, False, ModuleRef, TypeRef, ValueRef};
-use driver::session;
-use driver::session::session;
-use trans::base;
+use middle::trans::base;
 use middle::trans::common::*;
 use middle::trans::machine::*;
-use back::abi;
-use middle::ty;
 use middle::ty::field;
-use syntax::ast;
-use syntax::ast_util::dummy_sp;
-use syntax::util::interner;
+use middle::ty;
 use util::ppaux::ty_to_str;
-use syntax::codemap::span;
-use dvec::DVec;
 
+use core::dvec::DVec;
+use core::option::is_some;
 use std::map::HashMap;
-use option::is_some;
+use syntax::ast;
+use syntax::ast_util::dummy_sp;
+use syntax::codemap::span;
+use syntax::util::interner;
 
 use ty_ctxt = middle::ty::ctxt;
 
index 0504ce6d5699b2c66a7bf07eacc92c23fa36b927..2eaf15818d89f5cee5257a1adb7d55f8e7f51df3 100644 (file)
@@ -8,18 +8,19 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use syntax::ast;
-use lib::llvm::{ValueRef, TypeRef};
 use back::abi;
-use syntax::codemap::span;
-use shape::llsize_of;
-use build::*;
-use common::*;
+use lib::llvm::{ValueRef, TypeRef};
+use middle::trans::build::*;
+use middle::trans::common::*;
+use middle::trans::datum::*;
+use middle::trans::expr::{Dest, Ignore, SaveIn};
+use middle::trans::shape::llsize_of;
+use util::common::indenter;
 use util::ppaux::ty_to_str;
-use expr::{Dest, SaveIn, Ignore};
-use datum::*;
+
+use syntax::ast;
+use syntax::codemap::span;
 use syntax::print::pprust::{expr_to_str};
-use util::common::indenter;
 
 // Boxed vector types are in some sense currently a "shorthand" for a box
 // containing an unboxed vector. This expands a boxed vector type into such an
index 086407c8186b48257cb2e9b963d540e0c99dae1f..f146d556a9d9a31b011d3f056f74dbe00f7cb4ad 100644 (file)
@@ -8,12 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use common::*;
-use lib::llvm::{TypeRef};
-use syntax::ast;
 use lib::llvm::llvm;
-use driver::session::session;
+use lib::llvm::{TypeRef};
+use middle::trans::common::*;
+
 use std::map::HashMap;
+use syntax::ast;
 
 export type_of;
 export type_of_dtor;
index 33200a2dd828aa74c6bf84e14bde7a174becea87..2f9a97aa2d883c439a4f80af70d0d629d25ac15c 100644 (file)
 // much information, but have the disadvantage of being very
 // invasive.)
 
-use std::map::HashMap;
-use std::list;
-use std::list::{List, Cons, Nil};
 use metadata::csearch;
-use syntax::ast::*, syntax::ast_util, syntax::visit;
+use middle::trans::common::*;
+
+use std::list::{List, Cons, Nil};
+use std::list;
+use std::map::HashMap;
+use syntax::ast::*;
 use syntax::ast_map;
-use common::*;
+use syntax::ast_util;
+use syntax::visit;
 
 type type_uses = uint; // Bitmask
 const use_repr: uint = 1u;   /* Dependency on size/alignment/mode and
index 6a1fe50776dacb81291ebc80d956877f74bb4b02..30d47d60e589260cf8925e253dfbc4a3e721a64a 100644 (file)
@@ -8,12 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use syntax::ast;
 use lib::llvm::ValueRef;
-use common::*;
-use build::*;
-use base::*;
-use datum::immediate_rvalue;
+use middle::trans::base::*;
+use middle::trans::build::*;
+use middle::trans::common::*;
+use middle::trans::datum::immediate_rvalue;
+
+use syntax::ast;
 
 export make_free_glue, autoderef, duplicate;
 
index f037bffb4838e20de75e81755a38fe4e8f3c66cc..37958f84d5962b12095606d14d5c1479905cd2e6 100644 (file)
  * an rptr (`&r.T`) use the region `r` that appears in the rptr.
  */
 
-use check::fn_ctxt;
-use rscope::{anon_rscope, binding_rscope, empty_rscope, in_anon_rscope};
-use rscope::{in_binding_rscope, region_scope, type_rscope};
-use ty::{FnTyBase, FnMeta, FnSig};
+use middle::ty::{FnTyBase, FnMeta, FnSig};
+use middle::typeck::check::fn_ctxt;
+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};
 
-trait ast_conv {
+pub trait ast_conv {
     fn tcx() -> ty::ctxt;
     fn ccx() -> @crate_ctxt;
     fn get_item_ty(id: ast::def_id) -> ty::ty_param_bounds_and_ty;
@@ -141,7 +142,7 @@ fn ast_path_to_substs_and_ty<AC: ast_conv, RS: region_scope Copy Owned>(
     {substs: substs, ty: ty::subst(tcx, &substs, decl_ty)}
 }
 
-fn ast_path_to_ty<AC: ast_conv, RS: region_scope Copy Owned>(
+pub fn ast_path_to_ty<AC: ast_conv, RS: region_scope Copy Owned>(
     self: AC,
     rscope: RS,
     did: ast::def_id,
index ec39c659cf59c62acc80ba3755e5f9384ef2d3b3..9432ca186f94ed2242e8e3d75a1ab30ffcc7ded2 100644 (file)
@@ -8,9 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use middle::pat_util::{pat_is_binding, pat_is_const};
+use middle::pat_util::{pat_is_variant_or_struct};
+
+use syntax::ast_util::walk_pat;
 use syntax::print::pprust;
-use syntax::ast_util::{walk_pat};
-use pat_util::{pat_is_binding, pat_is_const, pat_is_variant_or_struct};
 
 fn check_alt(fcx: @fn_ctxt,
              expr: @ast::expr,
index a7e1da6ed7df7675899f7b7ea80227c36037576e..89726e22283d9523011b8251f87b0402851b9441 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use check::fn_ctxt;
+use middle::typeck::check::fn_ctxt;
 
 // Requires that the two types unify, and prints an error message if they
 // don't.
@@ -18,10 +18,10 @@ fn suptype(fcx: @fn_ctxt, sp: span,
         |sp, e, a, s| { fcx.report_mismatched_types(sp, e, a, s) })
 }
 
-fn suptype_with_fn(fcx: @fn_ctxt, sp: span,
-           expected: ty::t, actual: ty::t,
+fn suptype_with_fn(fcx: @fn_ctxt,
+                   sp: span,
+                   expected: ty::t, actual: ty::t,
                    handle_err: fn(span, ty::t, ty::t, &ty::type_err)) {
-
     // n.b.: order of actual, expected is reversed
     match infer::mk_subty(fcx.infcx(), false, sp,
                           actual, expected) {
@@ -32,9 +32,7 @@ fn suptype_with_fn(fcx: @fn_ctxt, sp: span,
     }
 }
 
-fn eqtype(fcx: @fn_ctxt, sp: span,
-          expected: ty::t, actual: ty::t) {
-
+fn eqtype(fcx: @fn_ctxt, sp: span, expected: ty::t, actual: ty::t) {
     match infer::mk_eqty(fcx.infcx(), false, sp, actual, expected) {
         Ok(()) => { /* ok */ }
         Err(ref err) => {
index 2b1078e7dd459de77351e92faca6e261e6dec480..8dfcb8c7bd9863282d14189c00f177940e555ee5 100644 (file)
@@ -79,16 +79,18 @@ trait `ToStr` imported, and I call `to_str()` on a value of type `T`,
 
 */
 
-use coherence::get_base_type_def_id;
 use middle::resolve::{Impl, MethodInfo};
 use middle::ty::*;
-use syntax::ast::{def_id, sty_by_ref, sty_value, sty_region, sty_box,
-                  sty_uniq, sty_static, node_id, by_copy, by_ref,
-                  m_const, m_mutbl, m_imm};
+use middle::typeck::check;
+use middle::typeck::coherence::get_base_type_def_id;
+
+use core::dvec::DVec;
+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};
 use syntax::ast_map;
 use syntax::ast_map::node_id_to_str;
 use syntax::ast_util::dummy_sp;
-use dvec::DVec;
 
 fn lookup(
     fcx: @fn_ctxt,
index 7611f62609f332794185e4447334eb9c9130b199..ace51539727ba0b46d0eff8a904d3f7ff4d3b4e6 100644 (file)
 
 */
 
-use astconv::{ast_conv, ast_path_to_ty, ast_ty_to_ty};
-use astconv::{ast_region_to_region};
 use middle::ty::{TyVid, vid, FnTyBase, FnMeta, FnSig, VariantInfo_};
-use regionmanip::{replace_bound_regions_in_fn_ty};
-use rscope::{anon_rscope, binding_rscope, empty_rscope, in_anon_rscope};
-use rscope::{in_binding_rscope, region_scope, type_rscope,
-                bound_self_region};
+use middle::typeck::astconv::{ast_conv, ast_path_to_ty};
+use middle::typeck::astconv::{ast_region_to_region, ast_ty_to_ty};
+use middle::typeck::check::regionmanip::replace_bound_regions_in_fn_ty;
+use middle::typeck::check::vtable::{LocationInfo, VtableContext};
+use middle::typeck::infer::{resolve_type, force_tvar};
+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 util::ppaux;
+
+use core::result::{Result, Ok, Err};
+use std::map::HashMap;
 use syntax::ast::ty_i;
-use typeck::infer::{resolve_type, force_tvar};
-use result::{Result, Ok, Err};
-use syntax::print::pprust;
-use syntax::parse::token::special_idents;
 use syntax::ast_util::{is_local, visibility_to_privacy, Private, Public};
-use vtable::{LocationInfo, VtableContext};
+use syntax::parse::token::special_idents;
+use syntax::print::pprust;
 
-use std::map::HashMap;
+export alt;
+export vtable;
+export writeback;
+export regionmanip;
+export regionck;
+export demand;
+export method;
+export fn_ctxt;
+export lookup_local;
+export impl_self_ty;
+export DerefArgs;
+export DontDerefArgs;
+export DoDerefArgs;
+export check_item_types;
 
 #[legacy_exports]
-mod alt;
+pub mod alt;
 #[legacy_exports]
-mod vtable;
+pub mod vtable;
 #[legacy_exports]
-mod writeback;
+pub mod writeback;
 #[legacy_exports]
-mod regionmanip;
+pub mod regionmanip;
 #[legacy_exports]
-mod regionck;
+pub mod regionck;
 #[legacy_exports]
-mod demand;
+pub mod demand;
 #[legacy_exports]
 pub mod method;
 
@@ -135,7 +151,7 @@ struct inherited {
 
 enum FnKind { ForLoop, DoBlock, Vanilla }
 
-struct fn_ctxt {
+pub struct fn_ctxt {
     // var_bindings, locals and next_var_id are shared
     // with any nested functions that capture the environment
     // (and with any functions whose environment is being captured).
@@ -252,9 +268,9 @@ fn check_fn(ccx: @crate_ctxt,
     let ret_ty = fn_ty.sig.output;
 
     debug!("check_fn(arg_tys=%?, ret_ty=%?, self_info.self_ty=%?)",
-           arg_tys.map(|a| ty_to_str(tcx, *a)),
-           ty_to_str(tcx, ret_ty),
-           option::map(&self_info, |s| ty_to_str(tcx, s.self_ty)));
+           arg_tys.map(|a| ppaux::ty_to_str(tcx, *a)),
+           ppaux::ty_to_str(tcx, ret_ty),
+           option::map(&self_info, |s| ppaux::ty_to_str(tcx, s.self_ty)));
 
     // ______________________________________________________________________
     // Create the function context.  This is either derived from scratch or,
@@ -631,7 +647,7 @@ fn block_region() -> ty::Region {
     #[inline(always)]
     fn write_ty(node_id: ast::node_id, ty: ty::t) {
         debug!("write_ty(%d, %s) in fcx %s",
-               node_id, ty_to_str(self.tcx(), ty), self.tag());
+               node_id, ppaux::ty_to_str(self.tcx(), ty), self.tag());
         self.inh.node_types.insert(node_id, ty);
     }
 
@@ -793,12 +809,13 @@ fn report_mismatched_return_types(sp: span, e: ty::t, a: ty::t,
                     self.tcx().sess.span_err(sp, fmt!("A for-loop body must \
                         return (), but it returns %s here. \
                         Perhaps you meant to write a `do`-block?",
-                                            ty_to_str(self.tcx(), a))),
+                                            ppaux::ty_to_str(self.tcx(), a))),
             DoBlock if ty::type_is_bool(e) && ty::type_is_nil(a) =>
                 // If we expected bool and got ()...
                     self.tcx().sess.span_err(sp, fmt!("Do-block body must \
                         return %s, but returns () here. Perhaps you meant \
-                        to write a `for`-loop?", ty_to_str(self.tcx(), e))),
+                        to write a `for`-loop?",
+                        ppaux::ty_to_str(self.tcx(), e))),
             _ => self.infcx().report_mismatched_types(sp, e, a, err)
         }
     }
@@ -921,10 +938,11 @@ fn check_expr(fcx: @fn_ctxt, expr: @ast::expr,
 // declared on the impl declaration e.g., `impl<A,B> for ~[(A,B)]`
 // would return ($0, $1) where $0 and $1 are freshly instantiated type
 // variables.
-fn impl_self_ty(vcx: &VtableContext,
-                location_info: &LocationInfo, // (potential) receiver for
-                                              // this impl
-                did: ast::def_id) -> ty_param_substs_and_ty {
+pub fn impl_self_ty(vcx: &VtableContext,
+                    location_info: &LocationInfo, // (potential) receiver for
+                                                  // this impl
+                    did: ast::def_id)
+                 -> ty_param_substs_and_ty {
     let tcx = vcx.tcx();
 
     let {n_tps, region_param, raw_ty} = if did.crate == ast::local_crate {
@@ -1540,7 +1558,7 @@ fn check_field(fcx: @fn_ctxt, expr: @ast::expr, is_callee: bool,
 
                 // (1) verify that the class id actually has a field called
                 // field
-                debug!("class named %s", ty_to_str(tcx, base_t));
+                debug!("class named %s", ppaux::ty_to_str(tcx, base_t));
                 let cls_items = ty::lookup_struct_fields(tcx, base_id);
                 match lookup_field_ty(tcx, base_id, cls_items,
                                       field, &(*substs)) {
@@ -2400,9 +2418,9 @@ fn get_node(f: &spanned<field>) -> field { f.node }
 
     debug!("type of expr %s is %s, expected is %s",
            syntax::print::pprust::expr_to_str(expr, tcx.sess.intr()),
-           ty_to_str(tcx, fcx.expr_ty(expr)),
+           ppaux::ty_to_str(tcx, fcx.expr_ty(expr)),
            match expected {
-               Some(t) => ty_to_str(tcx, t),
+               Some(t) => ppaux::ty_to_str(tcx, t),
                _ => ~"empty"
            });
 
@@ -2565,7 +2583,7 @@ fn check_instantiable(tcx: ty::ctxt,
         tcx.sess.span_err(sp, fmt!("this type cannot be instantiated \
                   without an instance of itself; \
                   consider using `option<%s>`",
-                                   ty_to_str(tcx, item_ty)));
+                                   ppaux::ty_to_str(tcx, item_ty)));
     }
 }
 
@@ -2678,7 +2696,7 @@ fn do_check(ccx: @crate_ctxt, sp: span, vs: ~[ast::variant],
     check_instantiable(ccx.tcx, sp, id);
 }
 
-fn lookup_local(fcx: @fn_ctxt, sp: span, id: ast::node_id) -> TyVid {
+pub fn lookup_local(fcx: @fn_ctxt, sp: span, id: ast::node_id) -> TyVid {
     match fcx.inh.locals.find(id) {
         Some(x) => x,
         _ => {
@@ -2893,7 +2911,7 @@ fn check_bounds_are_used(ccx: @crate_ctxt,
                          tps: ~[ast::ty_param],
                          ty: ty::t) {
     debug!("check_bounds_are_used(n_tps=%u, ty=%s)",
-           tps.len(), ty_to_str(ccx.tcx, ty));
+           tps.len(), ppaux::ty_to_str(ccx.tcx, ty));
 
     // make a vector of booleans initially false, set to true when used
     if tps.len() == 0u { return; }
@@ -3158,6 +3176,6 @@ fn arg(m: ast::rmode, ty: ty::t) -> ty::arg {
             tcx, None, false, it.span, i_ty.ty, fty,
             || fmt!("intrinsic has wrong type: \
                       expected `%s`",
-                     ty_to_str(ccx.tcx, fty)));
+                     ppaux::ty_to_str(ccx.tcx, fty)));
     }
 }
index 0f4511218ec82859c5980f5bd6ccb1cb0b044583..e58add83c0944d6e1546169f53d2108032039eb8 100644 (file)
 
 */
 
-use util::ppaux;
-use ppaux::{note_and_explain_region, ty_to_str};
-use syntax::print::pprust;
-use infer::{resolve_and_force_all_but_regions, fres};
-use syntax::ast::{def_arg, def_binding, def_local, def_self, def_upvar};
-use syntax::ast::{ProtoBare, ProtoBox, ProtoUniq, ProtoBorrowed};
 use middle::freevars::get_freevars;
 use middle::kind::check_owned;
 use middle::pat_util::pat_bindings;
 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::typeck::infer::{resolve_and_force_all_but_regions, fres};
+use util::ppaux::{note_and_explain_region, ty_to_str};
+
+use syntax::ast::{ProtoBare, ProtoBox, ProtoUniq, ProtoBorrowed};
+use syntax::ast::{def_arg, def_binding, def_local, def_self, def_upvar};
+use syntax::print::pprust;
 
 enum rcx { rcx_({fcx: @fn_ctxt, mut errors_reported: uint}) }
 type rvt = visit::vt<@rcx>;
index 8431c175eff53045a7ee2ffbb3a57cdfe6ba5573..0bcb032d8259cdc14afc16ab26ad749c660f3b6f 100644 (file)
@@ -11,6 +11,8 @@
 // #[warn(deprecated_mode)];
 // #[warn(deprecated_pattern)];
 
+use util::ppaux;
+
 use syntax::print::pprust::{expr_to_str};
 
 // Helper functions related to manipulating region types.
@@ -47,9 +49,9 @@ fn replace_bound_regions_in_fn_ty(
 
     debug!("replace_bound_regions_in_fn_ty(self_info.self_ty=%?, fn_ty=%s, \
                 all_tys=%?)",
-           self_ty.map(|t| ty_to_str(tcx, *t)),
-           ty_to_str(tcx, ty::mk_fn(tcx, *fn_ty)),
-           all_tys.map(|t| ty_to_str(tcx, *t)));
+           self_ty.map(|t| ppaux::ty_to_str(tcx, *t)),
+           ppaux::ty_to_str(tcx, ty::mk_fn(tcx, *fn_ty)),
+           all_tys.map(|t| ppaux::ty_to_str(tcx, *t)));
     let _i = indenter();
 
     let isr = do create_bound_region_mapping(tcx, isr, all_tys) |br| {
@@ -64,8 +66,8 @@ fn replace_bound_regions_in_fn_ty(
 
     debug!("result of replace_bound_regions_in_fn_ty: self_info.self_ty=%?, \
                 fn_ty=%s",
-           t_self.map(|t| ty_to_str(tcx, *t)),
-           ty_to_str(tcx, t_fn));
+           t_self.map(|t| ppaux::ty_to_str(tcx, *t)),
+           ppaux::ty_to_str(tcx, t_fn));
 
 
     // Glue updated self_ty back together with its original def_id.
index 0494f1563cf99bd56b8c0112c022aab39946667e..5751a462760641127c5e6df39ba7ba2ca77ce540 100644 (file)
@@ -8,13 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use check::{fn_ctxt, impl_self_ty};
-use infer::{infer_ctxt, resolve_type, resolve_and_force_all_but_regions,
-               fixup_err_to_str};
+use middle::typeck::check::{fn_ctxt, impl_self_ty};
+use middle::typeck::infer::{fixup_err_to_str, infer_ctxt};
+use middle::typeck::infer::{resolve_and_force_all_but_regions, resolve_type};
+use util::common::indenter;
+use util::ppaux;
+
+use result::{Result, Ok, Err};
 use syntax::codemap::span;
 use syntax::print::pprust;
-use result::{Result, Ok, Err};
-use util::common::indenter;
 
 // vtable resolution looks for places where trait bounds are
 // subsituted in and figures out which vtable is used. There is some
@@ -81,14 +83,14 @@ fn lookup_vtables(vcx: &VtableContext,
             tcx, bounds[i]) |trait_ty| {
 
             debug!("about to subst: %?, %?",
-                   ty_to_str(tcx, trait_ty),
+                   ppaux::ty_to_str(tcx, trait_ty),
                    ty::substs_to_str(tcx, substs));
 
             let new_substs = {self_ty: Some(*ty), ..*substs};
             let trait_ty = ty::subst(tcx, &new_substs, trait_ty);
 
             debug!("after subst: %?",
-                   ty_to_str(tcx, trait_ty));
+                   ppaux::ty_to_str(tcx, trait_ty));
 
             match lookup_vtable(vcx, location_info, *ty, trait_ty,
                                 allow_unsafe, is_early) {
@@ -98,8 +100,8 @@ fn lookup_vtables(vcx: &VtableContext,
                         location_info.span,
                         fmt!("failed to find an implementation of \
                               trait %s for %s",
-                             ty_to_str(vcx.tcx(), trait_ty),
-                             ty_to_str(vcx.tcx(), *ty)));
+                             ppaux::ty_to_str(vcx.tcx(), trait_ty),
+                             ppaux::ty_to_str(vcx.tcx(), *ty)));
                 }
             }
         }
@@ -664,8 +666,8 @@ fn early_resolve_expr(ex: @ast::expr, &&fcx: @fn_ctxt, is_early: bool) {
                             ex.span,
                             fmt!("failed to find an implementation of trait \
                                   %s for %s",
-                                 ty_to_str(fcx.tcx(), target_ty),
-                                 ty_to_str(fcx.tcx(), ty)));
+                                 ppaux::ty_to_str(fcx.tcx(), target_ty),
+                                 ppaux::ty_to_str(fcx.tcx(), ty)));
                     }
                 }
                 Some(vtable) => {
index 12d8f06a3f61044102377f2c0b0faed6c0b096d6..dd3f240f3434326e041bb05628780a7c080d19da 100644 (file)
 // unresolved type variables and replaces "ty_var" types with their
 // substitutions.
 
-use check::{fn_ctxt, lookup_local};
-use infer::{resolve_type, resolve_region, resolve_all, force_all};
+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 util::ppaux;
+
+use result::{Result, Ok, Err};
+
 export resolve_type_vars_in_fn;
 export resolve_type_vars_in_expr;
-use result::{Result, Ok, Err};
 
 fn resolve_type_vars_in_type(fcx: @fn_ctxt, sp: span, typ: ty::t)
     -> Option<ty::t>
@@ -97,7 +101,7 @@ fn resolve_type_vars_for_node(wbcx: wb_ctxt, sp: span, id: ast::node_id)
 
       Some(t) => {
         debug!("resolve_type_vars_for_node(id=%d, n_ty=%s, t=%s)",
-               id, ty_to_str(tcx, n_ty), ty_to_str(tcx, t));
+               id, ppaux::ty_to_str(tcx, n_ty), ppaux::ty_to_str(tcx, t));
         write_ty_to_tcx(tcx, id, t);
         match fcx.opt_node_ty_substs(id) {
           Some(ref substs) => {
index 3e5986f5236e62f4c4a13595676af0f89ba2c650..3ab3ac387f9ce57a4c1a3a672a4281b45779b449 100644 (file)
 use syntax::visit::{visit_mod};
 use util::ppaux::ty_to_str;
 
-use dvec::DVec;
-use result::Ok;
+use core::dvec::DVec;
+use core::result::Ok;
 use std::map::HashMap;
-use uint::range;
-use vec::{len, push};
+use core::uint::range;
+use core::vec::{len, push};
 
 fn get_base_type(inference_context: infer_ctxt, span: span, original_type: t)
               -> Option<t> {
index 5614c3aac80192ab008d1aede93e37e4160c1197..8e8d7380f8f392abd2685f2c27b471b5d5799ec8 100644 (file)
 
 */
 
-use astconv::{ast_conv, ty_of_fn_decl, ty_of_arg, ast_ty_to_ty};
-use ast_util::trait_method_to_ty_method;
-use middle::ty::{FnMeta, FnSig, FnTyBase};
-use rscope::*;
-use ty::{FnTyBase, FnMeta, FnSig, InstantiatedTraitRef};
+use middle::ty::{FnMeta, FnSig, FnTyBase, InstantiatedTraitRef};
+use middle::typeck::astconv::{ast_conv, ty_of_fn_decl, ty_of_arg};
+use middle::typeck::astconv::{ast_ty_to_ty};
+use middle::typeck::rscope::*;
 use util::common::pluralize;
+use util::ppaux;
 use util::ppaux::bound_to_str;
 
+use syntax::ast_util::trait_method_to_ty_method;
+
 fn collect_item_types(ccx: @crate_ctxt, crate: @ast::crate) {
 
     // FIXME (#2592): hooking into the "intrinsic" root module is crude.
@@ -403,10 +405,10 @@ fn compare_impl_method(tcx: ty::ctxt,
     // - replace self region with a fresh, dummy region
     let impl_fty = {
         let impl_fty = ty::mk_fn(tcx, impl_m.fty);
-        debug!("impl_fty (pre-subst): %s", ty_to_str(tcx, impl_fty));
+        debug!("impl_fty (pre-subst): %s", ppaux::ty_to_str(tcx, impl_fty));
         replace_bound_self(tcx, impl_fty, dummy_self_r)
     };
-    debug!("impl_fty: %s", ty_to_str(tcx, impl_fty));
+    debug!("impl_fty: %s", ppaux::ty_to_str(tcx, impl_fty));
     let trait_fty = {
         let dummy_tps = do vec::from_fn((*trait_m.tps).len()) |i| {
             // hack: we don't know the def id of the impl tp, but it
@@ -421,7 +423,7 @@ fn compare_impl_method(tcx: ty::ctxt,
             tps: vec::append(trait_tps, dummy_tps)
         };
         let trait_fty = ty::mk_fn(tcx, trait_m.fty);
-        debug!("trait_fty (pre-subst): %s", ty_to_str(tcx, trait_fty));
+        debug!("trait_fty (pre-subst): %s", ppaux::ty_to_str(tcx, trait_fty));
         ty::subst(tcx, &substs, trait_fty)
     };
 
@@ -574,7 +576,7 @@ fn convert(ccx: @crate_ctxt, it: @ast::item) {
       ast::item_trait(tps, supertraits, ref trait_methods) => {
         let tpt = ty_of_item(ccx, it);
         debug!("item_trait(it.id=%d, tpt.ty=%s)",
-               it.id, ty_to_str(tcx, tpt.ty));
+               it.id, ppaux::ty_to_str(tcx, tpt.ty));
         write_ty_to_tcx(tcx, it.id, tpt.ty);
         ensure_trait_methods(ccx, it.id, tpt.ty);
         ensure_supertraits(ccx, it.id, it.span, rp, supertraits);
@@ -774,7 +776,9 @@ fn ty_of_item(ccx: @crate_ctxt, it: @ast::item)
                    region_param: None,
                    ty: ty::mk_fn(ccx.tcx, tofd)};
         debug!("type of %s (id %d) is %s",
-               tcx.sess.str_of(it.ident), it.id, ty_to_str(tcx, tpt.ty));
+               tcx.sess.str_of(it.ident),
+               it.id,
+               ppaux::ty_to_str(tcx, tpt.ty));
         ccx.tcx.tcache.insert(local_def(it.id), tpt);
         return tpt;
       }
index 2ceff545eb73a17f74f5aea44b9a159d475931f5..1abe2156a1ebb50fe8dda0363a134aeb09ae1369 100644 (file)
@@ -58,8 +58,8 @@
 // A.  But this upper-bound might be stricter than what is truly
 // needed.
 
-use to_str::ToStr;
-use combine::combine_fields;
+use middle::typeck::infer::combine::combine_fields;
+use middle::typeck::infer::to_str::ToStr;
 
 fn to_ares(+c: cres<ty::t>) -> ares {
     match c {
index 1972be22b02fffc1c3840b86db5acc40853748db..da66ecd922b687c239c92e126b5fdae070b115b8 100644 (file)
@@ -54,8 +54,9 @@
 // terms of error reporting, although we do not do that properly right
 // now.
 
-use to_str::ToStr;
-use ty::{FnTyBase, FnMeta, FnSig};
+use middle::ty::{FnTyBase, FnMeta, FnSig};
+use middle::typeck::infer::to_str::ToStr;
+
 use syntax::ast::Onceness;
 
 fn macros() { include!("macros.rs"); } // FIXME(#3114): Macro import/export.
@@ -92,7 +93,7 @@ fn vstores(vk: ty::terr_vstore_kind,
                a: ty::vstore, b: ty::vstore) -> cres<ty::vstore>;
 }
 
-struct combine_fields {
+pub struct combine_fields {
     infcx: infer_ctxt,
     a_is_expected: bool,
     span: span,
@@ -108,7 +109,7 @@ fn expected_found<C: combine,T>(
     }
 }
 
-fn eq_tys<C: combine>(self: &C, a: ty::t, b: ty::t) -> ures {
+pub fn eq_tys<C: combine>(self: &C, a: ty::t, b: ty::t) -> ures {
     let suber = self.sub();
     do self.infcx().try {
         do suber.tys(a, b).chain |_ok| {
index 48b49c9c59c7798393cd81260e64ae98bfcf3f45..9537325c097f8384c75d6a92ce08e44d47f182ac 100644 (file)
@@ -14,8 +14,8 @@
 
 */
 
-use to_str::ToStr;
 use middle::ty::ty_float;
+use middle::typeck::infer::to_str::ToStr;
 
 // Bitvector to represent sets of floating-point types.
 pub enum float_ty_set = uint;
index 4d00b5f7d3c1d4a9823c0445b6ed3006419fb755..b6e179d27a91b9c52d41f902d04d9f3a168de7f2 100644 (file)
@@ -8,9 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use combine::*;
-use lattice::*;
-use to_str::ToStr;
+use middle::typeck::infer::combine::*;
+use middle::typeck::infer::lattice::*;
+use middle::typeck::infer::to_str::ToStr;
+
 use syntax::ast::{Many, Once};
 
 enum Glb = combine_fields;  // "greatest lower bound" (common subtype)
index 40f0bb1ac3e678f43e7ed0f6bc7c16027c4b81f6..f3e5e1ac73e623486b02afffeef8863561632493 100644 (file)
@@ -14,7 +14,7 @@
 
 */
 
-use to_str::ToStr;
+use middle::typeck::infer::to_str::ToStr;
 
 // Bitvector to represent sets of integral types
 enum int_ty_set = uint;
index fba0c5650040ecb831034e2ad19640aa793b4a72..b47dd2064522e2ba72501b5124eaccabab0fa668 100644 (file)
@@ -8,9 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use combine::*;
-use unify::*;
-use to_str::ToStr;
+use middle::typeck::infer::combine::*;
+use middle::typeck::infer::unify::*;
+use middle::typeck::infer::to_str::ToStr;
 
 // ______________________________________________________________________
 // Lattice operations on variables
index 563435d4600eebc8b37cb8e13b76f9be661627b1..cfb93e93a65ba26efbf9b66b2903c82cfdfd08e2 100644 (file)
@@ -8,9 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use combine::*;
-use lattice::*;
-use to_str::ToStr;
+use middle::typeck::infer::combine::*;
+use middle::typeck::infer::lattice::*;
+use middle::typeck::infer::to_str::ToStr;
+
 use syntax::ast::{Many, Once};
 
 fn macros() { include!("macros.rs"); } // FIXME(#3114): Macro import/export.
index 0d0a1d761cc1452ca21dfa557e581027d3944642..fb8ca5632910eeed5d135c0d9904c3fcce76cec9 100644 (file)
@@ -259,40 +259,40 @@ fn bar() {
 #[warn(deprecated_mode)];
 #[warn(deprecated_pattern)];
 
-use std::smallintmap;
-use std::smallintmap::smallintmap;
-use std::map::HashMap;
+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};
 use middle::ty;
-use middle::ty::{TyVid, IntVid, FloatVid, RegionVid, vid,
-                 ty_int, ty_uint, get, terr_fn, TyVar, IntVar, FloatVar};
-use syntax::{ast, ast_util};
-use syntax::ast::{ret_style, purity};
-use util::ppaux::{ty_to_str, mt_to_str};
-use result::{Result, Ok, Err, map_vec, map_vec2, iter_vec2};
-use ty::{mk_fn, type_is_bot};
-use check::regionmanip::{replace_bound_regions_in_fn_ty};
+use middle::typeck::check::regionmanip::{replace_bound_regions_in_fn_ty};
+use middle::typeck::infer::assignment::Assign;
+use middle::typeck::infer::combine::{combine_fields, eq_tys};
+use middle::typeck::infer::floating::{float_ty_set, float_ty_set_all};
+use middle::typeck::infer::glb::Glb;
+use middle::typeck::infer::integral::{int_ty_set, int_ty_set_all};
+use middle::typeck::infer::lub::Lub;
+use middle::typeck::infer::region_inference::{RegionVarBindings};
+use middle::typeck::infer::resolve::{force_all, not_regions};
+use middle::typeck::infer::resolve::{force_tvar, force_rvar, force_ivar};
+use middle::typeck::infer::resolve::{resolve_and_force_all_but_regions};
+use middle::typeck::infer::resolve::{resolve_ivar, resolve_all};
+use middle::typeck::infer::resolve::{resolve_nested_tvar, resolve_rvar};
+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 util::common::{indent, indenter};
-use ast::{unsafe_fn, impure_fn, pure_fn, extern_fn};
-use ast::{m_const, m_imm, m_mutbl};
-use dvec::DVec;
-use region_inference::{RegionVarBindings};
-use ast_util::dummy_sp;
-use cmp::Eq;
-
-// From submodules:
-use resolve::{resolve_nested_tvar, resolve_rvar, resolve_ivar, resolve_all,
-                 force_tvar, force_rvar, force_ivar, force_all, not_regions,
-                 resolve_and_force_all_but_regions, resolver};
-use unify::{vals_and_bindings, root};
-use integral::{int_ty_set, int_ty_set_all};
-use floating::{float_ty_set, float_ty_set_all};
-use combine::{combine_fields, eq_tys};
-use assignment::Assign;
-use to_str::ToStr;
-
-use sub::Sub;
-use lub::Lub;
-use glb::Glb;
+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 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_util::dummy_sp;
+use syntax::{ast, ast_util};
 
 export infer_ctxt;
 export new_infer_ctxt;
@@ -311,6 +311,18 @@ fn bar() {
 export assignment;
 export root, to_str;
 export int_ty_set_all;
+export assignment;
+export combine;
+export floating;
+export glb;
+export integral;
+export lattice;
+export lub;
+export region_inference;
+export resolve;
+export sub;
+export to_str;
+export unify;
 
 #[legacy_exports]
 mod assignment;
index f49d1740018693df2bad1859dda1b66efcd4dbb0..99d636559dbc26c05ed771c47480a2ce859a287d 100644 (file)
@@ -453,20 +453,20 @@ fn<a>(&a/T) <: fn<b>(&b/T)
 #[warn(deprecated_mode)];
 #[warn(deprecated_pattern)];
 
-use dvec::DVec;
+use middle::region::is_subregion_of;
+use middle::ty::{Region, RegionVid, re_static, re_infer, re_free, re_bound};
+use middle::ty::{re_scope, ReVar, ReSkolemized};
+use middle::typeck::infer::to_str::ToStr;
+use syntax::codemap;
+use util::ppaux::note_and_explain_region;
+
+use core::dvec::DVec;
 use result::Result;
 use result::{Ok, Err};
 use std::map::HashMap;
 use std::cell::{Cell, empty_cell};
 use std::list::{List, Nil, Cons};
 
-use region::is_subregion_of;
-use ty::{Region, RegionVid, re_static, re_infer, re_free, re_bound,
-         re_scope, ReVar, ReSkolemized};
-use syntax::codemap;
-use to_str::ToStr;
-use util::ppaux::note_and_explain_region;
-
 export RegionVarBindings;
 export make_subregion;
 export lub_regions;
index 437d5ade6bd214436c2657a43b39d0ecd2d33865..91689ff06ddc9e6e850423132c8bcb17531afc8d 100644 (file)
@@ -46,9 +46,9 @@
 // future).  If you want to resolve everything but one type, you are
 // probably better off writing `resolve_all - resolve_ivar`.
 
-use integral::*;
-use floating::*;
-use to_str::ToStr;
+use middle::typeck::infer::floating::*;
+use middle::typeck::infer::integral::*;
+use middle::typeck::infer::to_str::ToStr;
 
 const resolve_nested_tvar: uint = 0b00000001;
 const resolve_rvar: uint        = 0b00000010;
index b7769ac876d1bc01cbd8d463e329deacf5311169..1cec971f15629ede46f38c6fe8353ada1b214385 100644 (file)
@@ -8,9 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use combine::*;
-use unify::*;
-use to_str::ToStr;
+use middle::typeck::infer::combine::*;
+use middle::typeck::infer::to_str::ToStr;
+use middle::typeck::infer::unify::*;
+
 use std::list;
 
 fn macros() { include!("macros.rs"); } // FIXME(#3114): Macro import/export.
index a882f20c04b422d5acba108fe2316144bb0105b1..166907ba7a86207a769eb55750338dbc5f58d7d2 100644 (file)
@@ -8,9 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use integral::{int_ty_set};
-use floating::{float_ty_set};
-use unify::{var_value, redirect, root};
+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};
 
 trait ToStr {
     fn to_str(cx: infer_ctxt) -> ~str;
index 452e950dba600e4ae671f568f766528fb0930fc9..2ec356a6dc845ac2ce1744be09c05526a43faf31 100644 (file)
@@ -8,10 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use combine::combine;
-use integral::*;
-use floating::*;
-use to_str::ToStr;
+use middle::typeck::infer::combine::combine;
+use middle::typeck::infer::floating::*;
+use middle::typeck::infer::integral::*;
+use middle::typeck::infer::to_str::ToStr;
+
 use std::smallintmap::SmallIntMap;
 
 enum var_value<V:Copy, T:Copy> {
index e128f6a03fb5945e9531029619c6e4728fc9043a..aaf53e017388a0810932f5ba97540de5e6c75651 100644 (file)
 
 #[legacy_exports];
 
-use result::Result;
-use syntax::{ast, ast_util, ast_map};
-use ast::spanned;
-use ast::{required, provided};
-use syntax::ast_map::node_id_to_str;
-use syntax::ast_util::{local_def, respan, split_trait_methods,
-                       has_legacy_export_attr};
-use syntax::visit;
 use metadata::csearch;
-use util::common::{block_query, loop_query};
-use syntax::codemap::span;
-use pat_util::{pat_id_map, PatIdMap};
-use middle::ty;
+use middle::pat_util::{pat_id_map, PatIdMap};
 use middle::ty::{arg, field, node_type_table, mk_nil, ty_param_bounds_and_ty};
 use middle::ty::{ty_param_substs_and_ty, vstore_uniq};
-use std::smallintmap;
-use std::map;
+use middle::ty;
+use util::common::{block_query, indent, indenter, loop_query};
+use util::ppaux::{bound_region_to_str, vstore_to_str, expr_repr};
+use util::ppaux::{ty_to_str, tys_to_str, region_to_str};
+use util::ppaux;
+
+use core::dvec::DVec;
+use core::result::Result;
+use std::list::{List, Nil, Cons};
+use std::list;
 use std::map::HashMap;
+use std::map;
+use std::smallintmap;
+use syntax::ast::{provided, required, spanned};
+use syntax::ast_map::node_id_to_str;
+use syntax::ast_util::{has_legacy_export_attr};
+use syntax::ast_util::{local_def, respan, split_trait_methods};
+use syntax::codemap::span;
 use syntax::print::pprust::*;
-use util::ppaux::{ty_to_str, tys_to_str, region_to_str,
-                  bound_region_to_str, vstore_to_str, expr_repr};
-use util::common::{indent, indenter};
-use std::list;
-use list::{List, Nil, Cons};
-use dvec::DVec;
+use syntax::visit;
+use syntax::{ast, ast_util, ast_map};
 
 export check;
 export check_crate;
 export vtable_static, vtable_param, vtable_trait;
 export provided_methods_map;
 export coherence;
+export check;
+export rscope;
+export astconv;
+export infer;
+export collect;
+export coherence;
+export deriving;
 
 #[legacy_exports]
 #[path = "check/mod.rs"]
 pub mod check;
 #[legacy_exports]
-mod rscope;
+pub mod rscope;
 #[legacy_exports]
-mod astconv;
+pub mod astconv;
 #[path = "infer/mod.rs"]
-mod infer;
+pub mod infer;
 #[legacy_exports]
-mod collect;
+pub mod collect;
 #[legacy_exports]
-mod coherence;
+pub mod coherence;
 
 #[auto_serialize]
 #[auto_deserialize]
-enum method_origin {
+pub enum method_origin {
     // fully statically resolved method
     method_static(ast::def_id),
 
@@ -139,7 +146,7 @@ enum method_origin {
     bound_num: uint
 };
 
-type method_map_entry = {
+pub type method_map_entry = {
     // the type and mode of the self parameter, which is not reflected
     // in the fn type (FIXME #3446)
     self_arg: ty::arg,
@@ -153,12 +160,12 @@ enum method_origin {
 
 // maps from an expression id that corresponds to a method call to the details
 // of the method to be invoked
-type method_map = HashMap<ast::node_id, method_map_entry>;
+pub type method_map = HashMap<ast::node_id, method_map_entry>;
 
 // Resolutions for bounds of all parameters, left to right, for a given path.
-type vtable_res = @~[vtable_origin];
+pub type vtable_res = @~[vtable_origin];
 
-enum vtable_origin {
+pub enum vtable_origin {
     /*
       Statically known vtable. def_id gives the class or impl item
       from whence comes the vtable, and tys are the type substs.
@@ -198,7 +205,7 @@ fn to_str(tcx: ty::ctxt) -> ~str {
             vtable_trait(def_id, ref tys) => {
                 fmt!("vtable_trait(%?:%s, %?)",
                      def_id, ty::item_path_str(tcx, def_id),
-                     tys.map(|t| ty_to_str(tcx, *t)))
+                     tys.map(|t| ppaux::ty_to_str(tcx, *t)))
             }
         }
     }
@@ -220,7 +227,7 @@ enum crate_ctxt {
 
 // Functions that write types into the node type table
 fn write_ty_to_tcx(tcx: ty::ctxt, node_id: ast::node_id, ty: ty::t) {
-    debug!("write_ty_to_tcx(%d, %s)", node_id, ty_to_str(tcx, ty));
+    debug!("write_ty_to_tcx(%d, %s)", node_id, ppaux::ty_to_str(tcx, ty));
     smallintmap::insert(*tcx.node_types, node_id as uint, ty);
 }
 fn write_substs_to_tcx(tcx: ty::ctxt,
@@ -228,7 +235,7 @@ fn write_substs_to_tcx(tcx: ty::ctxt,
                        +substs: ~[ty::t]) {
     if substs.len() > 0u {
         debug!("write_substs_to_tcx(%d, %?)", node_id,
-               substs.map(|t| ty_to_str(tcx, *t)));
+               substs.map(|t| ppaux::ty_to_str(tcx, *t)));
         tcx.node_type_substs.insert(node_id, substs);
     }
 }
@@ -356,13 +363,13 @@ fn check_main_fn_ty(ccx: @crate_ctxt,
                     main_span,
                     fmt!("Wrong type in main function: found `%s`, \
                           expected `fn() -> ()`",
-                         ty_to_str(tcx, main_t)));
+                         ppaux::ty_to_str(tcx, main_t)));
             }
         }
         _ => {
             tcx.sess.span_bug(main_span,
                               ~"main has a non-function type: found `" +
-                              ty_to_str(tcx, main_t) + ~"`");
+                              ppaux::ty_to_str(tcx, main_t) + ~"`");
         }
     }
 }
index 5ae52252dc22342853af1195831baebe0a98277b..cbbb417eae6a5ffa2fdf5cbe9d0a14934118a18a 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use result::Result;
+use core::result::Result;
 use syntax::parse::token::special_idents;
 
 trait region_scope {
index 584f165b75dafa2a45a16ff9a3f1c1af18290792..45aa78be02606fbb1b8adb08370479c3bc383339 100644 (file)
@@ -145,7 +145,7 @@ mod middle {
     #[path = "middle/lint.rs"]
     mod lint;
     #[path = "middle/borrowck/mod.rs"]
-    mod borrowck;
+    pub mod borrowck;
     #[legacy_exports]
     #[path = "middle/mem_categorization.rs"]
     mod mem_categorization;
index a11943fbf4bcabe7361d932d1188447d75e7ef3d..a0685c4b3ac992ff6693d4cd380dd4c88dd5860d 100644 (file)
 non-sendableness.
 */
 
-use std::map::HashMap;
-use rustc::driver::session;
-use session::{basic_options, options};
-use session::Session;
+use rustc::back::link;
 use rustc::driver::driver;
-use syntax::diagnostic;
-use syntax::diagnostic::handler;
+use rustc::driver::session::Session;
+use rustc::driver::session::{basic_options, options};
+use rustc::driver::session;
+use rustc::front;
+use rustc::metadata::filesearch;
+use std::map::HashMap;
 use syntax::ast;
-use syntax::codemap;
 use syntax::ast_map;
-use rustc::back::link;
-use rustc::metadata::filesearch;
-use rustc::front;
+use syntax::codemap;
+use syntax::diagnostic::handler;
+use syntax::diagnostic;
 
 pub type Ctxt = {
     ast: @ast::crate,
index 7351f2f7b30b9ad2d4aeeb25530b61a0d6cb5a0c..db97f34f20168d49ef8ab1ebc35e48c32747b028 100644 (file)
 
 //! AST-parsing helpers
 
+use rustc::driver::driver::{file_input, str_input};
 use rustc::driver::driver;
-use driver::{file_input, str_input};
 use rustc::driver::session;
-use syntax::diagnostic;
 use syntax::ast;
 use syntax::codemap;
+use syntax::diagnostic;
 use syntax::parse;
 
 pub fn from_file(file: &Path) -> @ast::crate {
index 9393168905a4e2967948eef1326f1e63353eab30..a2e1167eaa816a21213d5e0709c5fe6b3b1232c6 100644 (file)
@@ -28,7 +28,7 @@ extern mod rustc(vers = "0.5");
 extern mod syntax(vers = "0.5");
 
 use core::*;
-use io::{ReaderUtil, WriterUtil};
+use core::io::{ReaderUtil, WriterUtil};
 use rustc::back;
 use rustc::driver::{driver, session};
 use rustc::front;
@@ -38,8 +38,8 @@ use rustc::middle::{freevars, kind, lint, trans, ty, typeck};
 use rustc::middle;
 use syntax::{ast, ast_util, codemap, diagnostic, fold, parse, print, visit};
 use syntax::ast_util::*;
-use parse::token;
-use print::{pp, pprust};
+use syntax::parse::token;
+use syntax::print::{pp, pprust};
 use std::rl;
 
 /**
index d41aa1227ce9c031ce02ea01c606b88cb8a2601c..8a3e6213325a78fc9dfd818a0fde5b64c8acf107 100644 (file)
@@ -582,4 +582,4 @@ fn read_to_vec<T>(&self, f: fn() -> T) -> ~[T] {
 }
 }
 
-pub use traits::*;
+pub use serialization::traits::*;
index a53c03d6d2ce6c2b7a1a997bd02d887ff9a1674f..c9754ad99801c8e4d6859ab55dacc2fab524c26e 100644 (file)
@@ -12,9 +12,8 @@
 
 #[forbid(deprecated_mode)];
 
-use uv = uv;
 use uv::iotask;
-use iotask::IoTask;
+use uv::iotask::IoTask;
 use comm = core::comm;
 
 /**
index be503216edbbb8d8923744e195677e1401772dcf..58b9a8d3d944528175711ca80b02cc6852a56348 100644 (file)
 use ll = uv_ll;
 use iotask = uv_iotask;
 use get_gl = get;
-use iotask::{IoTask, spawn_iotask};
+use uv_iotask::{IoTask, spawn_iotask};
 use private::{chan_from_global_ptr, weaken_task};
 use comm = core::comm;
-use comm::{Port, Chan, select2, listen};
+use core::comm::{Port, Chan, select2, listen};
 use task::TaskBuilder;
 use either::{Left, Right};
 
index b718c84b65ed22fdf9fce3e276bb3b07108d8f41..19f5997a57d7342515a6207b25e63a5941632406 100644 (file)
@@ -19,7 +19,7 @@
 use libc::c_void;
 use ptr::addr_of;
 use comm = core::comm;
-use comm::{Port, Chan, listen};
+use core::comm::{Port, Chan, listen};
 use task::TaskBuilder;
 use ll = uv_ll;
 
index 9830a5b1434fbf512e385926f6107eb67d5e364e..359414cff42bc6d1410995b66e7c96a52f850571 100644 (file)
@@ -88,7 +88,7 @@ impl<
 
 */
 
-use base::*;
+use ext::base::*;
 use codemap::span;
 use std::map;
 use std::map::HashMap;
index 04a59d1fe4162d835ee38d731e186bfc78c6b587..0d40ede4dbcdb6e9b234e7e1e81f48dd5f38ca16 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 use codemap::span;
-use base::ext_ctxt;
+use ext::base::ext_ctxt;
 
 fn mk_expr(cx: ext_ctxt, sp: codemap::span, expr: ast::expr_) ->
     @ast::expr {
index a47b64bea3af109f50c49819d9fce81317fcc3a0..d84d79082a4f8a33212388adf278bf1d403efaf3 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use base::*;
+use ext::base::*;
 
 fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: ~[ast::token_tree])
     -> base::mac_result {
index 434c00e7487eb99cb5f4d68039534e2113802f78..f0eaf2115b8960a4a23e65e42ee227f52561fdb5 100644 (file)
@@ -18,7 +18,7 @@
 use ast::{struct_variant_kind, sty_by_ref, sty_region, tuple_variant_kind};
 use ast::{ty_nil, ty_param, ty_param_bound, ty_path, ty_rptr, unnamed_field};
 use ast::{variant};
-use base::ext_ctxt;
+use ext::base::ext_ctxt;
 use codemap::span;
 use parse::token::special_idents::clownshoes_extensions;
 
index 68db1b41781e40f6041d53518443eb4f09a33803..b5c55437d70b325c24b6ba419a9fbb270d1648b6 100644 (file)
@@ -14,8 +14,8 @@
  * should all get sucked into either the compiler syntax extension plugin
  * interface.
  */
-use base::*;
-use build::mk_uniq_str;
+use ext::base::*;
+use ext::build::mk_uniq_str;
 export expand_syntax_ext;
 
 fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: ~[ast::token_tree])
index 46003624a76e512155bf65f3f693f06b521b3007..2b5f95c4066dae38a4a5f5c03c0c236c34faeef2 100644 (file)
@@ -16,7 +16,7 @@
  * compiler syntax extension plugin interface.
  */
 use extfmt::ct::*;
-use base::*;
+use ext::base::*;
 use codemap::span;
 use ext::build::*;
 export expand_syntax_ext;
index 00462207b4bdd4237a3f994c08e7b8ca46638b9e..47096182fe848140073277ef3ce3db3e8129efe4 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use base::*;
+use ext::base::*;
 use io::WriterUtil;
 
 fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, tt: ~[ast::token_tree])
index 2a7b09795ced681d3914e61fb3228c178f47acd4..56f426e3853bfc78dec06c5afb392d2f9b41b9d6 100644 (file)
@@ -17,7 +17,7 @@
 use ast_util::{ident_to_path, respan, dummy_sp};
 use codemap::span;
 use ext::base::mk_ctxt;
-use quote::rt::*;
+use ext::quote::rt::*;
 
 // Transitional reexports so qquote can find the paths it is looking for
 mod syntax {
index cd76655fef66fd3c60b1712953daf8fce1c6a852..7193a00950e28fd33cf305ee137dc6ede3c21dab 100644 (file)
@@ -31,7 +31,7 @@
 
 use ext::base::ext_ctxt;
 
-use proto::{state, protocol, next_state};
+use ext::pipes::proto::{state, protocol, next_state};
 
 impl ext_ctxt: proto::visitor<(), (), ()>  {
     fn visit_proto(_proto: protocol,
index 7085ca40ed39e2326c8cee48994ac23e74f937ce..0a02bca88ca99859045a029f0998c9a39a1d2590 100644 (file)
@@ -49,9 +49,8 @@
 use parse::lexer::{new_tt_reader, reader};
 use parse::parser::Parser;
 
-use pipes::parse_proto::proto_parser;
-
-use pipes::proto::{visit, protocol};
+use ext::pipes::parse_proto::proto_parser;
+use ext::pipes::proto::{visit, protocol};
 
 #[legacy_exports]
 mod ast_builder;
index ffc063d2b77e4ba42e7a1efc33f19a415a914751..0f6b9dbda284349bc3bd3de97130367f2c1103ff 100644 (file)
@@ -13,7 +13,7 @@
 use parse::parser;
 use parse::token;
 
-use pipec::*;
+use ext::pipes::pipec::*;
 
 trait proto_parser {
     fn parse_proto(id: ~str) -> protocol;
index 5ce3898b3e85909f950f53c6ce6bb7aacf4aa5e4..c07170e5c364097e4ae7bab3aff1e2c58e7bf03d 100644 (file)
 use util::interner;
 use ext::base::ext_ctxt;
 use parse::*;
-use proto::*;
-use quote::rt::*;
-use ast_builder::{append_types, path};
-
-// Transitional reexports so qquote can find the paths it is looking for
-mod syntax {
-    #[legacy_exports];
-    pub use ext;
-    pub use parse;
-}
+use ext::pipes::proto::*;
+use ext::quote::rt::*;
+use ext::pipes::ast_builder::{append_types, path};
 
 trait gen_send {
     fn gen_send(cx: ext_ctxt, try: bool) -> @ast::item;
index af75c9e71dcf0b306357b59e9ab28fa3472fa856..76757d027a5c82a7b6637a996f012ea35e153b43 100644 (file)
@@ -11,7 +11,7 @@
 use to_str::ToStr;
 use dvec::DVec;
 
-use ast_builder::{path, append_types};
+use ext::pipes::ast_builder::{path, append_types};
 
 enum direction { send, recv }
 
index 1e5d4ea8d16f884f863b4f1864156fe5225b052f..c498c3407c28ab523d4fc9eb6e5d9502b450925d 100644 (file)
@@ -13,7 +13,7 @@
 
 use codemap::{span, BytePos};
 use ext::base::ext_ctxt;
-use token::*;
+use parse::token::*;
 
 /**
 *
@@ -34,7 +34,7 @@ pub mod rt {
     pub use codemap::span;
 
     use print::pprust;
-    use pprust::{item_to_str, ty_to_str};
+    use print::pprust::{item_to_str, ty_to_str};
 
     trait ToTokens {
         pub fn to_tokens(_cx: ext_ctxt) -> ~[token_tree];
index 8d2b9163f152fd7800c245424bba77f82812d63e..099764a3278b4eff0e1412801a911c84535ca49b 100644 (file)
@@ -8,10 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use base::*;
+use ext::base::*;
 use codemap::{span, Loc, FileMap};
 use print::pprust;
-use build::{mk_base_vec_e,mk_uint,mk_u8,mk_uniq_str};
+use ext::build::{mk_base_vec_e, mk_uint, mk_u8, mk_uniq_str};
 
 export expand_line;
 export expand_col;
index f33c8b802040cdbb5f569fa6f9e826e9f4154b66..e93f3d6e38b24d8538e3b6979d74641857898c0f 100644 (file)
@@ -8,15 +8,16 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use base::{ext_ctxt, mac_result, mr_any, mr_def, normal_tt};
+use ext::base::{ext_ctxt, mac_result, mr_any, mr_def, normal_tt};
 use codemap::span;
 use ast::{ident, matcher_, matcher, match_tok,
              match_nonterminal, match_seq, tt_delim};
 use parse::lexer::{new_tt_reader, reader};
 use parse::token::{FAT_ARROW, SEMI, LBRACE, RBRACE, nt_matchers, nt_tt};
 use parse::parser::Parser;
-use macro_parser::{parse, parse_or_else, success, failure, named_match,
-                      matched_seq, matched_nonterminal, error};
+use ext::tt::macro_parser::{parse, parse_or_else, success, failure,
+                            named_match, matched_seq, matched_nonterminal,
+                            error};
 use std::map::HashMap;
 use parse::token::special_idents;
 use ast_util::dummy_sp;
index 19b5975c147256b636110b6bb38c3ecddcaa8460..a68482ea46b3653484df210b69017ba2ad3e69d4 100644 (file)
@@ -10,7 +10,7 @@
 
 use diagnostic::span_handler;
 use ast::{token_tree, tt_delim, tt_tok, tt_seq, tt_nonterminal,ident};
-use macro_parser::{named_match, matched_seq, matched_nonterminal};
+use ext::tt::macro_parser::{named_match, matched_seq, matched_nonterminal};
 use codemap::span;
 use parse::token::{EOF, INTERPOLATED, IDENT, Token, nt_ident, ident_interner};
 use std::map::HashMap;
index 7248a0e224476a6e83cb7546a00fed02c5ae8283..a4bef47fdf290bfa89171a6166ad29252d49ae9a 100644 (file)
@@ -10,7 +10,7 @@
 
 use either::{Either, Left, Right};
 use ast_util::spanned;
-use common::*; //resolve bug?
+use parse::common::*; //resolve bug?
 
 export parser_attr;
 
index e5a526286279069121d786de9e071a3b251102b0..22b40736748b54238fc6bb8e0b10778807ea70be 100644 (file)
@@ -8,11 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use io::println;//XXXXXXXXxxx
 use io::ReaderUtil;
 use util::interner;
-use lexer::{string_reader, bump, is_eof, nextch,
-               is_whitespace, get_str_from, reader};
+use parse::lexer::{string_reader, bump, is_eof, nextch,
+                   is_whitespace, get_str_from, reader};
 use codemap::{FileMap, CharPos};
 
 export cmnt;
index a48e33c94059c42b1969b7c7b97940baa904b4e0..246a8fa9c7c55075b6e7689e89ab2d7c6642f415 100644 (file)
@@ -10,8 +10,8 @@
 
 use std::map::{HashMap};
 use ast_util::spanned;
-use parser::Parser;
-use lexer::reader;
+use parse::parser::Parser;
+use parse::lexer::reader;
 
 type seq_sep = {
     sep: Option<token::Token>,
index 5a7b62f1ff6ce658dbd950e1efd9dfd8a4e8fd7e..803135f7599e20dcb76e1f3c9081b0699e066b09 100644 (file)
@@ -20,6 +20,7 @@
 export prec;
 export classify;
 export attr;
+export obsolete;
 
 export parse_sess;
 export new_parse_sess, new_parse_sess_special_handler;
 export parse_tts_from_source_str;
 export parse_from_source_str;
 
-use parser::Parser;
-use attr::parser_attr;
 use ast::node_id;
-use util::interner;
+use codemap::{span, CodeMap, FileMap, CharPos, BytePos};
 use diagnostic::{span_handler, mk_span_handler, mk_handler, emitter};
-use lexer::{reader, string_reader};
+use parse::attr::parser_attr;
+use parse::lexer::{reader, string_reader};
+use parse::parser::Parser;
 use parse::token::{ident_interner, mk_ident_interner};
-use codemap::{span, CodeMap, FileMap, CharPos, BytePos};
+use util::interner;
 
 
 #[legacy_exports]
index aa52575ef45b473bb02d8aa5f6c05a8822d41972..3db635f3b431d3fba362eaa45e9c7694d0acbf07 100644 (file)
@@ -20,7 +20,7 @@
 use codemap::span;
 use ast::{expr, expr_lit, lit_nil};
 use ast_util::{respan};
-use token::Token;
+use parse::token::Token;
 
 /// The specific types of unsupported syntax
 pub enum ObsoleteSyntax {
index 0f1c3467625216f1be9356a54d44b8b8f1073ae2..47f65ed2f8d37ed2ba217cd78edaf2b2483a006a 100644 (file)
 use result::Result;
 use either::{Either, Left, Right};
 use std::map::HashMap;
-use token::{can_begin_expr, is_ident, is_ident_or_path, is_plain_ident,
-            INTERPOLATED, special_idents};
+use parse::token::{can_begin_expr, is_ident, is_ident_or_path, is_plain_ident,
+                   INTERPOLATED, special_idents};
 use codemap::{span,FssNone, BytePos};
 use util::interner::Interner;
 use ast_util::{spanned, respan, mk_sp, ident_to_path, operator_prec};
-use lexer::reader;
-use prec::{as_prec, token_to_binop};
-use attr::parser_attr;
-use common::{seq_sep_trailing_disallowed, seq_sep_trailing_allowed,
-                seq_sep_none, token_to_str};
+use parse::lexer::reader;
+use parse::prec::{as_prec, token_to_binop};
+use parse::attr::parser_attr;
+use parse::common::{seq_sep_trailing_disallowed, seq_sep_trailing_allowed,
+                    seq_sep_none, token_to_str};
 use dvec::DVec;
 use vec::{push};
-use obsolete::{
+use parse::obsolete::{
     ObsoleteSyntax,
     ObsoleteLowerCaseKindBounds, ObsoleteLet,
     ObsoleteFieldTerminator, ObsoleteStructCtor,
index 8dada97e35ddb4d46a159cbc9e93d3afcaf85404..4663b875bb5d7a23cf3b73dc852014a229da9a86 100644 (file)
@@ -12,8 +12,8 @@
 export unop_prec;
 export token_to_binop;
 
-use token::*;
-use token::Token;
+use parse::token::*;
+use parse::token::Token;
 use ast::*;
 
 /// Unary operators have higher precedence than binary
index fa384341fb9734f1199721a7ebd16a4f4f2c9924..e977327e919b45e561230f08b35aebbceafcdc8d 100644 (file)
@@ -10,8 +10,8 @@
 
 use parse::{comments, lexer, token};
 use codemap::{CodeMap, BytePos};
-use pp::{break_offset, word, printer, space, zerobreak, hardbreak, breaks};
-use pp::{consistent, inconsistent, eof};
+use print::pp::{break_offset, word, printer, space, zerobreak, hardbreak};
+use print::pp::{breaks, consistent, inconsistent, eof};
 use ast::{required, provided};
 use ast_util::{operator_prec};
 use dvec::DVec;
index fbc5f10fcd6f9e794d7a9fc45814756faf9f05c9..119e1e25fb7c1c57fc037c4a18425df110040013 100644 (file)
@@ -31,6 +31,11 @@ extern mod std(vers = "0.5");
 
 use core::*;
 
+pub mod syntax {
+    pub use ext;
+    pub use parse;
+}
+
 #[legacy_exports]
 mod attr;
 #[legacy_exports]
index 8c885f1b79748124c5ae2bf7de129595badfa538..5e7424cf41e64d137eb8eb052203a11f9819b8f0 100644 (file)
@@ -12,7 +12,7 @@
 
 export foo;
 
-use comm::*;
+use core::comm::*;
 
 fn foo<T: Send Copy>(x: T) -> Port<T> {
     let p = Port();
index efd42fb588c7129755a7d61f1cef4784c8e4d9ac..162f7de4b1b43b9b5f6db36588bde9a353e07896 100644 (file)
@@ -16,6 +16,6 @@ fn g(){}
         }
     }
 
-    pub use b::c;
+    pub use a::b::c;
 }
 
diff --git a/src/test/compile-fail/super-at-top-level.rs b/src/test/compile-fail/super-at-top-level.rs
new file mode 100644 (file)
index 0000000..21b9e52
--- /dev/null
@@ -0,0 +1,7 @@
+use super::f;   //~ ERROR unresolved name
+//~^ ERROR failed to resolve import
+
+fn main() {
+    
+}
+
index 7dbaee44135e2b34815b7801a3e6a0c2d11d5d37..beb1a5fc6c237604c017e9c85788c667e2a74f3f 100644 (file)
@@ -11,8 +11,6 @@
 
 
 // Regression test for issue #374
-extern mod std;
-use option::None;
 
 enum sty { ty_nil, }
 
index edc5c6bb9779e3d79cb2eaf5c21cbc4311d690be..c90bec114ed26e3dc1cf179dba0681b32ea14865 100644 (file)
 
 
 // -*- rust -*-
-use core::sys;
-
 enum t { make_t(@int), clam, }
 
 fn foo(s: @int) {
-    let count = sys::refcount(s);
+    let count = core::sys::refcount(s);
     let x: t = make_t(s); // ref up
 
     match x {
@@ -26,20 +24,20 @@ fn foo(s: @int) {
       }
       _ => { debug!("?"); fail; }
     }
-    log(debug, sys::refcount(s));
-    assert (sys::refcount(s) == count + 1u);
-    let _ = sys::refcount(s); // don't get bitten by last-use.
+    log(debug, core::sys::refcount(s));
+    assert (core::sys::refcount(s) == count + 1u);
+    let _ = core::sys::refcount(s); // don't get bitten by last-use.
 }
 
 fn main() {
     let s: @int = @0; // ref up
 
-    let count = sys::refcount(s);
+    let count = core::sys::refcount(s);
 
     foo(s); // ref up then down
 
-    log(debug, sys::refcount(s));
-    let count2 = sys::refcount(s);
-    let _ = sys::refcount(s); // don't get bitten by last-use.
+    log(debug, core::sys::refcount(s));
+    let count2 = core::sys::refcount(s);
+    let _ = core::sys::refcount(s); // don't get bitten by last-use.
     assert count == count2;
 }
index 943896943fe4603f02d8dbca3a5d3ed8643d2ad2..bd0e91f153e2265fd26cd1e2992492c79ce882b0 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use to_str::ToStr;
-
 trait Foo {
     fn f(&self);
 }
@@ -37,4 +35,4 @@ fn g(&self) {
 fn main() {
     let y = Bar { x: 42 };
     y.f();
-}
\ No newline at end of file
+}
index fd9b30935cc9ed0aa8fc1c282d61bd4fadbab1f6..5472903f32b300d9d4998bdeb8fbad8be825fbe5 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 31ca6b7e1d130b28891528b9441cbf82d1ad2e8f..834040e0e57f9fc6a34ba4e7f40a69b2d179977e 100644 (file)
 // except according to those terms.
 
 
-extern mod std;
-use comm::Chan;
-use comm::Port;
-use comm::send;
-use comm::recv;
-
-fn a(c: Chan<int>) { send(c, 10); }
+fn a(c: core::comm::Chan<int>) { core::comm::send(c, 10); }
 
 fn main() {
-    let p = Port();
-    let ch = Chan(&p);
+    let p = core::comm::Port();
+    let ch = core::comm::Chan(&p);
     task::spawn(|| a(ch) );
     task::spawn(|| a(ch) );
     let mut n: int = 0;
-    n = recv(p);
-    n = recv(p);
+    n = core::comm::recv(p);
+    n = core::comm::recv(p);
     //    debug!("Finished.");
 }
 
-fn b(c: Chan<int>) {
+fn b(c: core::comm::Chan<int>) {
     //    debug!("task b0");
     //    debug!("task b1");
     //    debug!("task b2");
     //    debug!("task b3");
     //    debug!("task b4");
     //    debug!("task b5");
-    send(c, 10);
+    core::comm::send(c, 10);
 }
index 6d2e096b8dab3e1e7d85c2812d7387cf7f702b0e..df8eb39da30433d34d15ca2f3cb895a7aefe3c7b 100644 (file)
 // except according to those terms.
 
 
-extern mod std;
-use comm::Port;
-use comm::send;
-use comm::Chan;
-use comm::recv;
-
-fn a(c: Chan<int>) { debug!("task a0"); debug!("task a1"); send(c, 10); }
+fn a(c: core::comm::Chan<int>) {
+    debug!("task a0");
+    debug!("task a1");
+    core::comm::send(c, 10);
+}
 
 fn main() {
-    let p = Port();
-    let ch = Chan(&p);
+    let p = core::comm::Port();
+    let ch = core::comm::Chan(&p);
     task::spawn(|| a(ch) );
     task::spawn(|| b(ch) );
     let mut n: int = 0;
-    n = recv(p);
-    n = recv(p);
+    n = core::comm::recv(p);
+    n = core::comm::recv(p);
     debug!("Finished.");
 }
 
-fn b(c: Chan<int>) {
+fn b(c: core::comm::Chan<int>) {
     debug!("task b0");
     debug!("task b1");
     debug!("task b2");
     debug!("task b2");
     debug!("task b3");
-    send(c, 10);
+    core::comm::send(c, 10);
 }
index d58791f4bf118926fa75124a8d91a80111a6c91d..bc7b194d7b4e30d0d3975ec30d2ef639ade04e2a 100644 (file)
 // except according to those terms.
 
 
-extern mod std;
-use comm::send;
-use comm::Chan;
-use comm::recv;
-
-fn a(c: Chan<int>) {
+fn a(c: core::comm::Chan<int>) {
     if true {
         debug!("task a");
         debug!("task a");
@@ -23,7 +18,7 @@ fn a(c: Chan<int>) {
         debug!("task a");
         debug!("task a");
     }
-    send(c, 10);
+    core::comm::send(c, 10);
 }
 
 fn k(x: int) -> int { return 15; }
@@ -39,18 +34,18 @@ fn main() {
     let mut n: int = 2 + 3 * 7;
     let s: ~str = ~"hello there";
     let p = comm::Port();
-    let ch = comm::Chan(&p);
+    let ch = core::comm::Chan(&p);
     task::spawn(|| a(ch) );
     task::spawn(|| b(ch) );
     let mut x: int = 10;
     x = g(n, s);
     log(debug, x);
-    n = recv(p);
-    n = recv(p);
+    n = core::comm::recv(p);
+    n = core::comm::recv(p);
     debug!("children finished, root finishing");
 }
 
-fn b(c: Chan<int>) {
+fn b(c: core::comm::Chan<int>) {
     if true {
         debug!("task b");
         debug!("task b");
@@ -59,5 +54,5 @@ fn b(c: Chan<int>) {
         debug!("task b");
         debug!("task b");
     }
-    send(c, 10);
+    core::comm::send(c, 10);
 }
index 768551dddfcc3ea371eae60214146a37fa162408..9c2a16e3e37e629add88618164e72d91fe7e8ba4 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // xfail-test
+// xfail-fast
 extern mod std;
 use std::arc;
 fn dispose(+_x: arc::ARC<bool>) unsafe { }
index a1cd6c0544eb50d518a0d67dbf38536b612b66e9..72299e2b329c1e52878f8f40c6cb6a012a8b4176 100644 (file)
@@ -10,9 +10,6 @@
 
 // Binop corner cases
 
-extern mod std;
-use cast::reinterpret_cast;
-
 fn test_nil() {
     assert (() == ());
     assert (!(() != ()));
@@ -66,9 +63,9 @@ fn test_box() {
 }
 
 fn test_ptr() unsafe {
-    let p1: *u8 = cast::reinterpret_cast(&0);
-    let p2: *u8 = cast::reinterpret_cast(&0);
-    let p3: *u8 = cast::reinterpret_cast(&1);
+    let p1: *u8 = core::cast::reinterpret_cast(&0);
+    let p2: *u8 = core::cast::reinterpret_cast(&0);
+    let p3: *u8 = core::cast::reinterpret_cast(&1);
 
     assert p1 == p2;
     assert p1 != p3;
@@ -113,8 +110,8 @@ fn test_class() {
   
   unsafe {
   error!("q = %x, r = %x",
-         (cast::reinterpret_cast::<*p, uint>(&ptr::addr_of(&q))),
-         (cast::reinterpret_cast::<*p, uint>(&ptr::addr_of(&r))));
+         (core::cast::reinterpret_cast::<*p, uint>(&ptr::addr_of(&q))),
+         (core::cast::reinterpret_cast::<*p, uint>(&ptr::addr_of(&r))));
   }
   assert(q == r);
   r.y = 17;
index 0017d760402ee1b48404af130556a4b11d2a153a..ff0de7a469660a9e4be4a5a101280a78939dbcf1 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index ef82884e690a98f5fee84794df1209b279358afe..93ab2ba2c4134a280518d14f822d900eba46b72f 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use ptr::to_uint;
-
 fn borrow(x: &int, f: fn(x: &int)) {
     f(x)
 }
@@ -18,11 +16,11 @@ fn test1(x: @~int) {
     // Right now, at least, this induces a copy of the unique pointer:
     do borrow({*x}) |p| {
         let x_a = ptr::addr_of(&(**x));
-        assert (x_a as uint) != to_uint(p);
+        assert (x_a as uint) != ptr::to_uint(p);
         assert unsafe{*x_a} == *p;
     }
 }
 
 fn main() {
     test1(@~22);
-}
\ No newline at end of file
+}
index 7bd178726029099442993bda5133f6f154a7ba0e..3eaf273a5785e9a1c3b18fc3192f90508c161a9a 100644 (file)
@@ -8,12 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use dvec::DVec;
-
 fn foo() -> int { 22 }
 
 fn main() {
-    let x = DVec::<@fn() -> int>();
+    let x = dvec::DVec::<@fn() -> int>();
     x.push(foo);
     assert (x[0])() == 22;
-}
\ No newline at end of file
+}
index 565c04309021ee2b24ceffdedd6f0cf109c56b0c..c82fc0bcd6860a0238204c64571bc03f3b44bdc6 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 // compile-flags:-Z no-opt
-use comm::*;
 
 // This test has to be setup just so to trigger
 // the condition which was causing us a crash.
@@ -25,9 +24,9 @@
 // course preferable, as the value itself is
 // irrelevant).
 
-fn foo(&&x: ()) -> Port<()> {
-    let p = Port();
-    let c = Chan(&p);
+fn foo(&&x: ()) -> core::comm::Port<()> {
+    let p = core::comm::Port();
+    let c = core::comm::Chan(&p);
     do task::spawn() |copy c, copy x| {
         c.send(x);
     }
index c0cdc8ebfe0448caa9fbbbc778e08ce405fedae5..b88799c4475d37ac05cdc6d76e5f1cd0f61dd5e8 100644 (file)
 
 // Issue #763
 
-extern mod std;
-use comm::Chan;
-use comm::send;
-use comm::Port;
-use comm::recv;
+enum request { quit, close(core::comm::Chan<bool>), }
 
-enum request { quit, close(Chan<bool>), }
+type ctx = core::comm::Chan<request>;
 
-type ctx = Chan<request>;
-
-fn request_task(c: Chan<ctx>) {
-    let p = Port();
-    send(c, Chan(&p));
+fn request_task(c: core::comm::Chan<ctx>) {
+    let p = core::comm::Port();
+    core::comm::send(c, core::comm::Chan(&p));
     let mut req: request;
-    req = recv(p);
+    req = core::comm::recv(p);
     // Need to drop req before receiving it again
-    req = recv(p);
+    req = core::comm::recv(p);
 }
 
 fn new_cx() -> ctx {
-    let p = Port();
-    let ch = Chan(&p);
+    let p = core::comm::Port();
+    let ch = core::comm::Chan(&p);
     let t = task::spawn(|| request_task(ch) );
     let mut cx: ctx;
-    cx = recv(p);
+    cx = core::comm::recv(p);
     return cx;
 }
 
 fn main() {
     let cx = new_cx();
 
-    let p = Port::<bool>();
-    send(cx, close(Chan(&p)));
-    send(cx, quit);
+    let p = core::comm::Port::<bool>();
+    core::comm::send(cx, close(core::comm::Chan(&p)));
+    core::comm::send(cx, quit);
 }
index 72e10bd22f2c9b29d94aa319adf67632e1378c52..b3e85c518956efbcdea119dd8102a290c3eb2c29 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 7b0cf49ee22ba46fb85b8b51473073b222946e38..cae462c4d5d930f3467adf00409b05376a12612c 100644 (file)
 // except according to those terms.
 
 
-extern mod std;
-use comm::Chan;
-use comm::send;
-use comm::recv;
-
 fn main() {
     let p = comm::Port();
-    let ch = comm::Chan(&p);
+    let ch = core::comm::Chan(&p);
     let t = task::spawn(|| child(ch) );
-    let y = recv(p);
+    let y = core::comm::recv(p);
     error!("received");
     log(error, y);
     assert (y == 10);
 }
 
-fn child(c: Chan<int>) {
+fn child(c: core::comm::Chan<int>) {
     error!("sending");
-    send(c, 10);
+    core::comm::send(c, 10);
     error!("value sent");
 }
index c41644585ef2350a487cf45d171e4f181c0f3bfc..5ddea6055870443ff186044cff88934194ff5b87 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 9200610c4cf90669fc31ad73a748970ef2a991a5..a78ca37172b28d94220033adf2787f614536786d 100644 (file)
 
 // Regression test that f64 exports things properly
 
-use io::println;
-
 fn main() {
 
     let digits: uint = 10 as uint;
 
-    println(float::to_str(f64::sqrt(42.0f64) as float, digits));
-}
\ No newline at end of file
+    core::io::println(float::to_str(f64::sqrt(42.0f64) as float, digits));
+}
index cd745241450c8103ba6b03af1e097c3e838567bf..4d1ad84225d4e4bb0a14e96b2b7c75015388ac37 100644 (file)
 // except according to those terms.
 
 
-extern mod std;
-use comm::Port;
-use comm::Chan;
-use comm::send;
-use comm::recv;
-
 fn main() {
-    let po = Port();
-    let ch = Chan(&po);
-    send(ch, 10);
-    let i = recv(po);
+    let po = core::comm::Port();
+    let ch = core::comm::Chan(&po);
+    core::comm::send(ch, 10);
+    let i = core::comm::recv(po);
     assert (i == 10);
-    send(ch, 11);
-    let j = recv(po);
+    core::comm::send(ch, 11);
+    let j = core::comm::recv(po);
     assert (j == 11);
 }
index c3c54312bfce85ebc8c51be9666192fbf1cb8c71..f569e9116e39a963b4808e4d0a41e9a27fe19dcc 100644 (file)
@@ -8,10 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use dvec::DVec;
-
 fn main() {
-    let d = DVec();
+    let d = dvec::DVec();
     d.push(3);
     d.push(4);
     assert d.get() == ~[3, 4];
index 5c7c6636f674a57a51c4c2928eb4de045b36bb35..5f547e09c8951eb445dfd1a657d65b63fc1d7f87 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
@@ -15,7 +17,7 @@
 
 mod foo {
     #[legacy_exports];
-    use bar::*;
+    use foo::bar::*;
     mod bar {
         #[legacy_exports];
         const a : int = 10;
index 3d647072b5c6b0a9faed3cfa59218882a88e9dfa..4c0287843fc05a322787fa7a2a4b60da5e08a5a6 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
@@ -15,8 +17,9 @@
 
 mod foo {
     #[legacy_exports];
-    use bar::*;
+    use foo::bar::*;
     export a;
+    export bar;
     mod bar {
         #[legacy_exports];
         const a : int = 10;
index bd2d6d2fcab2314bfdb7996bc9c506c21aa3852e..c9d7fe4d6b9df918ae86ca25332282d4741aeed0 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 2abc0881370c7d7913e6d1e4431477b6de7194ee..badff7bdfd69adbee6be2eebbc8ce0e1eb9c4165 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 8e59058f818baa18055ff71f6fddd5cf9a898e85..166625ce1a819946c07c7e0b09c1412bd355cc09 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index ab1aca4d76153476a30a2d819d1ee7e66cd9e307..66e48d1e7a95c483e803b6515c02081269b4340f 100644 (file)
@@ -1,5 +1,3 @@
-use option::*;
-
 enum Q { R(Option<uint>) }
 
 fn xyzzy(q: Q) -> uint {
@@ -12,4 +10,4 @@ fn xyzzy(q: Q) -> uint {
 
 fn main() {
     assert xyzzy(R(Some(5))) == 0;
-}
\ No newline at end of file
+}
index fb4a474f0c088debda8c38cb2d3d0778ee3558b4..9a3b67e42dc7724c982a0f78f1e07861e066c014 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
@@ -16,8 +18,6 @@
 
 extern mod std;
 
-use option::Some;
-use option::None;
 use std::map;
 use std::map::HashMap;
 use comm::Chan;
index 83c7d3d6f59d18c82537d3397f989f83885c88e7..9106f4a5e750f736cd32e67cb99524885f92f009 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index e334e4bed50a04390e9cf5818a92d7df22ce1177..390ccf35e376b793153af5c5a63342bba93c8a45 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index cf4234358e86518907c8f013ab1f19acabd08f92..5297ee61d202014e4fb70603d28532140810918a 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 612078ecf783f9757d5e345f06b732a24031055a..32770f39c0ec55bdc3b10b64362e831cd4fd52c7 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index bd73da0ee52d2f8775e4021e412cdb7d95297e58..0d3d08b3a39ac466a760cdd4b0674e79bf2c7de9 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 5283c7e84994b286eb9ef7fc798c98f07952044e..58b45f3d5f81d724f1a4a17bf5981e440560d87b 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
-
 fn main() {
     use vec::to_mut;
     log(debug, vec::len(to_mut(~[1, 2])));
index 9babd89055de9852c07c4fe0a6dd4f19258c5e7e..4a1ad3c5100578b5d502195ec7df06208715a8b4 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 0e6e986cba76c70b88e01ed154668adc4f44ad32..a3fdefaeba60340051a852fa0f8521c620d3e1fb 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index f8337beb687fc7a18b0ec3833216a10a5a582a33..34f67340a28f367648d0ddb8b3c70b5506bf5058 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index cbea124c5a0921ee846fd180bd85ea6bc3581e24..b3545d9ec8c87de12c26c0897118b07d0d01054e 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 90ef72c14e284bca262d0719e797f9e4c9df2ed5..9941648c4f03d63d235facc61d1f8125176758cf 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 0e3eae3a6cb9611e0e90fa8251ed83f126092c6f..554aa4154b30b64a20b95e8d6d571a152b4278ca 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
@@ -11,8 +13,9 @@
 use foo::bar;
 mod foo {
     #[legacy_exports];
-    use zed::bar;
+    use foo::zed::bar;
     export bar;
+    export zed;
     mod zed {
         #[legacy_exports];
         fn bar() { debug!("foo"); }
index 8fa362e596a9a3e6125a286737463a480f5299fc..5ffbc0895bd23906fed58d2945050e73118520b8 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 917e8108daaabc28ff707f388ba23288392b513d..579a1e093ceea8f82b6c2150bbd4ed0ba61d9fbf 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index b4ca26138a0fddb61878bd236551d587b34b4d99..d05e88a2b8d6a2462afb13cda8d4df0d9c184e12 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 352cd089cdcbbafc3dbda990f2f0688e2c7330e5..19ce8e8d224faf510f8438f98773fe7d5b51b87b 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index f0eb3fc24052dfc9efddabaa90f77c9b2a00df5c..8eca57eacbf72ee01afea4d5a2720278f406391d 100644 (file)
@@ -11,9 +11,6 @@
 // Issue #1112
 // Alignment of interior pointers to dynamic-size types
 
-extern mod std;
-use ptr::addr_of;
-
 type x<T> = {
     a: T,
     b: u8,
@@ -44,4 +41,4 @@ fn bar<T>(x: x<T>) {
     assert x.e == 11u16;
     assert x.f == 12u8;
     assert x.g == 13u8;
-}
\ No newline at end of file
+}
index ef757f6394ac914d9bbe29a3b2fbe1fe93f38fcd..72ce678cd2384544c2477355a3f2728c79e2c307 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 0c616957557322e9f2c0286855e668ff3713d279..05c2595931eb1d2ce08b263fc3327a89f6e0a53d 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
@@ -36,4 +38,4 @@ fn main() {
   let mut y: int = 5;
   let x: &mut int = &mut y;
   assert (lgamma(1.0 as c_double, x) == 0.0 as c_double);
-}
\ No newline at end of file
+}
index 49661a31cdbc60bb01b8418dd4d5a8967dd760ff..eb7506aa3d28e36e07a0bc725037be980fa73250 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 1cc9783dd5b2c91f1e1d1328154cf23f70e93428..7cf681c9f94efbab299aee2da506a19b9ce5670c 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use dvec::DVec;
-
 struct c1<T: Copy> {
     x: T,
 }
index 690cc6a4ab767732fe8880d64a0f99617b980bfe..a8412aacee9816529c2be7d5bc8e5200c2bf2083 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 750bdbd570f878020547ad921f7b17c6ca26ab80..c79b59f7cd99d36a09b505ef5e8bc4696c694438 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index ba3bd2869f2be73440b4c810d6d46416a6b933f4..cb81dad98faa5f079a2c6383cfc1a5a44c1a3d52 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 0a7c7ddce2dc8777e33aebb94a1147c4082b7e72..a21cad8fd3939b6cf8488d315a09d312873dec3c 100644 (file)
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use sys::size_of;
-extern mod std;
-
 struct Cat {
     x: int
 }
@@ -25,12 +22,12 @@ fn finalize(&self) {}
 
 #[cfg(target_arch = "x86_64")]
 fn main() {
-    assert (size_of::<Cat>() == 8 as uint);
-    assert (size_of::<Kitty>() == 16 as uint);
+    assert (sys::size_of::<Cat>() == 8 as uint);
+    assert (sys::size_of::<Kitty>() == 16 as uint);
 }
 
 #[cfg(target_arch = "x86")]
 fn main() {
-    assert (size_of::<Cat>() == 4 as uint);
-    assert (size_of::<Kitty>() == 8 as uint);
+    assert (sys::size_of::<Cat>() == 4 as uint);
+    assert (sys::size_of::<Kitty>() == 8 as uint);
 }
index c228c8199f2082912902c8cd7dad5ff6b13f7ad9..506f9dfa64ee2f9d1da7e6687cccd7890d44af6e 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index a0a7fd5f3ff2bead2803a70631dafd51bb2ea4a1..04932676f3d63074f5e3db53a42473dbe4b204b1 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 012a827c2394a14142dfa3ec8a08e31dbd7a8880..74f67ff92809a81ea17c7f7d87a608ed75d1b053 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use option::*;
-
 type Connection = fn@(~[u8]);
 
 fn f() -> Option<Connection> {
index e24384fcc12fe57132f32da23dd691887167568c..6064713b295272c73eb981abff8f10dc4677e600 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 3464f3a363f27b8bc63712629c044b8cd1198c27..ee68a546cafedd3353135002b5a4b3746e10c673 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 942114eef6c8db24ee9055667fdcbc52e806b55d..9045e3aecda3c0ccf36db6aa324caa0259bcd2c7 100644 (file)
@@ -8,15 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use io::println;
-
 fn main() {
   trait Text {
     fn to_str(&self) -> ~str;
   }
 
   fn to_string(t: Text) {
-    println(t.to_str());
+    io::println(t.to_str());
   }
 
 }
index 92c8e6494da998fcf23eabd644028ada792de026..5d267f9d91447bba2960c9be02a7a2177e0d3809 100644 (file)
    https://github.com/graydon/rust/issues/507
 */
 
-extern mod std;
+fn grandchild(c: core::comm::Chan<int>) { core::comm::send(c, 42); }
 
-use comm::Chan;
-use comm::send;
-use comm::Port;
-use comm::recv;
-
-fn grandchild(c: Chan<int>) { send(c, 42); }
-
-fn child(c: Chan<int>) {
+fn child(c: core::comm::Chan<int>) {
     task::spawn(|| grandchild(c) )
 }
 
 fn main() {
-    let p = comm::Port();
-    let ch = Chan(&p);
+    let p = core::comm::Port();
+    let ch = core::comm::Chan(&p);
 
     task::spawn(|| child(ch) );
 
-    let x: int = recv(p);
+    let x: int = core::comm::recv(p);
 
     log(debug, x);
 
index 890dce22bff3d6df3be7a7ffb6fdb1bffe5030ba..bac6dc67ac2bf84b4af6dda6d653c091a8d9abca 100644 (file)
@@ -8,26 +8,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
-use comm::Chan;
-use comm::Port;
-use comm::recv;
-use comm::send;
-
 enum msg { closed, received(~[u8]), }
 
-fn producer(c: Chan<~[u8]>) {
-    send(c, ~[1u8, 2u8, 3u8, 4u8]);
+fn producer(c: core::comm::Chan<~[u8]>) {
+    core::comm::send(c, ~[1u8, 2u8, 3u8, 4u8]);
     let empty: ~[u8] = ~[];
-    send(c, empty);
+    core::comm::send(c, empty);
 }
 
-fn packager(cb: Chan<Chan<~[u8]>>, msg: Chan<msg>) {
-    let p: Port<~[u8]> = Port();
-    send(cb, Chan(&p));
+fn packager(cb: core::comm::Chan<core::comm::Chan<~[u8]>>, msg: core::comm::Chan<msg>) {
+    let p: core::comm::Port<~[u8]> = core::comm::Port();
+    core::comm::send(cb, core::comm::Chan(&p));
     loop {
         debug!("waiting for bytes");
-        let data = recv(p);
+        let data = core::comm::recv(p);
         debug!("got bytes");
         if vec::len(data) == 0u {
             debug!("got empty bytes, quitting");
@@ -35,26 +29,26 @@ fn packager(cb: Chan<Chan<~[u8]>>, msg: Chan<msg>) {
         }
         debug!("sending non-empty buffer of length");
         log(debug, vec::len(data));
-        send(msg, received(data));
+        core::comm::send(msg, received(data));
         debug!("sent non-empty buffer");
     }
     debug!("sending closed message");
-    send(msg, closed);
+    core::comm::send(msg, closed);
     debug!("sent closed message");
 }
 
 fn main() {
-    let p: Port<msg> = Port();
-    let ch = Chan(&p);
-    let recv_reader: Port<Chan<~[u8]>> = Port();
-    let recv_reader_chan = Chan(&recv_reader);
+    let p: core::comm::Port<msg> = core::comm::Port();
+    let ch = core::comm::Chan(&p);
+    let recv_reader: core::comm::Port<core::comm::Chan<~[u8]>> = core::comm::Port();
+    let recv_reader_chan = core::comm::Chan(&recv_reader);
     let pack = task::spawn(|| packager(recv_reader_chan, ch) );
 
-    let source_chan: Chan<~[u8]> = recv(recv_reader);
+    let source_chan: core::comm::Chan<~[u8]> = core::comm::recv(recv_reader);
     let prod = task::spawn(|| producer(source_chan) );
 
     loop {
-        let msg = recv(p);
+        let msg = core::comm::recv(p);
         match msg {
           closed => { debug!("Got close message"); break; }
           received(data) => {
index 5174b57e4f0cd6e356e831460d8ca9549257bc50..2654a7385993f09637f3a1e37d943a772956e657 100644 (file)
@@ -8,20 +8,16 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
-use comm::*;
-use task::spawn;
-
 fn a() {
     fn doit() {
-        fn b(c: Chan<Chan<int>>) {
-            let p = Port();
-            send(c, Chan(&p));
+        fn b(c: core::comm::Chan<core::comm::Chan<int>>) {
+            let p = core::comm::Port();
+            core::comm::send(c, core::comm::Chan(&p));
         }
-        let p = Port();
-        let ch = Chan(&p);
-        spawn(|| b(ch) );
-        recv(p);
+        let p = core::comm::Port();
+        let ch = core::comm::Chan(&p);
+        task::spawn(|| b(ch) );
+        core::comm::recv(p);
     }
     let mut i = 0;
     while i < 100 {
@@ -32,6 +28,6 @@ fn b(c: Chan<Chan<int>>) {
 
 fn main() {
     for iter::repeat(100u) {
-        spawn(|| a() );
+        task::spawn(|| a() );
     }
 }
index b92d20bbe40c106091c05d44d54283872f665308..4a33d770872b03718263aa142e6f7baf2edc71b5 100644 (file)
@@ -1,20 +1,13 @@
-extern mod std;
-
-use comm::Chan;
-use comm::Port;
-use comm::send;
-use comm::recv;
-
-fn producer(c: Chan<~[u8]>) {
-    send(c,
+fn producer(c: core::comm::Chan<~[u8]>) {
+    core::comm::send(c,
          ~[1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8, 8u8, 9u8, 10u8, 11u8, 12u8,
           13u8]);
 }
 
 fn main() {
-    let p: Port<~[u8]> = Port();
-    let ch = Chan(&p);
+    let p: core::comm::Port<~[u8]> = core::comm::Port();
+    let ch = core::comm::Chan(&p);
     let prod = task::spawn(|| producer(ch) );
 
-    let data: ~[u8] = recv(p);
+    let data: ~[u8] = core::comm::recv(p);
 }
index dabc211279ee8ec8c865cf72719a8a738a554cc5..a093b89b70f4b99d24a2302ee2c7a37028da0e3e 100644 (file)
@@ -9,26 +9,22 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-extern mod std;
-use comm::*;
-
 fn main() {
-    let p = Port();
-    let ch = Chan(&p);
+    let p = core::comm::Port();
+    let ch = core::comm::Chan(&p);
     let mut y: int;
 
     task::spawn(|| child(ch) );
-    y = recv(p);
+    y = core::comm::recv(p);
     debug!("received 1");
     log(debug, y);
     assert (y == 10);
 
     task::spawn(|| child(ch) );
-    y = recv(p);
+    y = core::comm::recv(p);
     debug!("received 2");
     log(debug, y);
     assert (y == 10);
 }
 
-fn child(c: Chan<int>) { send(c, 10); }
+fn child(c: core::comm::Chan<int>) { core::comm::send(c, 10); }
index a47e482908bcd1373fb02f28f80c83931f4effed..af2fe623c447d2998eb6a8cf58e6a204b953fc03 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 61d10fcbfd64159ca92705bbcb670c64fdb1690f..94edb596b5f73f3695324642af57cd8d4c06f1a4 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-test not a test. used by mod-merge-hack.rs
 
-use T = inst::T;
+use T = self::inst::T;
 
 pub const bits: uint = inst::bits;
 pub pure fn min(x: T, y: T) -> T { if x < y { x } else { y } }
index b76d57ddfe70d516b347f605b061cac54efd3438..dd5f7484f10374917fdf6b36bb1329abe87bad96 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 0cbd8cc616d26f98959edd2750c92ee46ab65519..450b697bfb1c3f594cc0d1724051ab9056c55705 100644 (file)
@@ -11,9 +11,6 @@
 
 
 // a bug was causing this to complain about leaked memory on exit
-extern mod std;
-use option::Some;
-use option::None;
 
 enum t { foo(int, uint), bar(int, Option<int>), }
 
index daf1b461f900fdb3f7b6e16251c76f02a99e35ce..620bd04905324ca52510df508a30416043cc9d1c 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 9deba54a1a87c0faf9df907cb840512032078901..2f863a4211b9e25f4b6f0778db8d2f724407e906 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index bb86ba8f45aeba8c05128107fae445a2c3a43a04..c2d4be04191bc00b14f11cc8158047a0b576a530 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 7ca81a6d13ac98e5b727259e516b70e0af37143f..d7d0ccfc40440a39d323fc7decbd82d63a2a2bd4 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 5dd23a28fd78b2c3e53c5938325c71a4314030cb..8589bbb8e257f06c5a2b9388f0dd34f0072c3e9a 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 8228cf5a19cf90afdc4632792cbde9b887f45859..88db8953b8c333f3ec9567f47bb378eacca7965e 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 82c011f1060324276be1e21ed1bb86c995e6086d..173325834c068d1f5ff72e228f156eda9f29ea1e 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 020d0fe06191a1fc54948abe862e14f0fb75d7e6..d14b89aff7750e977c604ca758ea134cdd55dfe1 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index c465621ac8376a2b05485ce9cc5621721a057c66..4a6e7b4ce36a8faf7c49f0e4f6e577ed788f6f4e 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
@@ -29,4 +31,4 @@ fn main() {
     sleep(iotask, 500);
     
     signal(move c);
-}
\ No newline at end of file
+}
index 0b3ab7fa746ed72f19000f8981364efe71066abf..71023d6c7f48b5d90683e3b28fd952bb0d95e4c6 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 0574794deb4f517d7961d629ac06c3937b63a682..b59ce4d9020e77e0c1671dba1bc0bcac3518fcf8 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 5b4ec1c85c9e0e16b27b7fdc1344e836d3940287..0fd1b361b2973e6f27f21db7a7f0dfcf358e3e8e 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index db5f7345a64e573b38da6c65330a7f36017ca2ec..054c29c2a05714170258ee603970b0b03fb58e35 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use libc, sys, cast;
-
 enum arena = ();
 
 type bcx = {
index a644f9fcb1e0e4722c18730a2ce145cfeaf72932..6fde5bef741360cc57a227d9342c9013e6b8f8d6 100644 (file)
 
 // Regression tests for circular_buffer when using a unit
 // that has a size that is not a power of two
-extern mod std;
-use comm::Port;
-use comm::Chan;
-use comm::send;
-use comm::recv;
 
-// A 12-byte unit to send over the channel
+// A 12-byte unit to core::comm::send over the channel
 type record = {val1: u32, val2: u32, val3: u32};
 
 
 // power of two so needs to be rounded up. Don't trigger any
 // assertions.
 fn test_init() {
-    let myport = Port();
-    let mychan = Chan(&myport);
+    let myport = core::comm::Port();
+    let mychan = core::comm::Chan(&myport);
     let val: record = {val1: 0u32, val2: 0u32, val3: 0u32};
-    send(mychan, val);
+    core::comm::send(mychan, val);
 }
 
 
 // Dump lots of items into the channel so it has to grow.
 // Don't trigger any assertions.
 fn test_grow() {
-    let myport = Port();
-    let mychan = Chan(&myport);
+    let myport = core::comm::Port();
+    let mychan = core::comm::Chan(&myport);
     for uint::range(0u, 100u) |i| {
         let val: record = {val1: 0u32, val2: 0u32, val3: 0u32};
-        comm::send(mychan, val);
+        core::comm::send(mychan, val);
     }
 }
 
 
 // Don't allow the buffer to shrink below it's original size
 fn test_shrink1() {
-    let myport = Port();
-    let mychan = Chan(&myport);
-    send(mychan, 0i8);
-    let x = recv(myport);
+    let myport = core::comm::Port();
+    let mychan = core::comm::Chan(&myport);
+    core::comm::send(mychan, 0i8);
+    let x = core::comm::recv(myport);
 }
 
 fn test_shrink2() {
-    let myport = Port();
-    let mychan = Chan(&myport);
+    let myport = core::comm::Port();
+    let mychan = core::comm::Chan(&myport);
     for uint::range(0u, 100u) |_i| {
         let val: record = {val1: 0u32, val2: 0u32, val3: 0u32};
-        send(mychan, val);
+        core::comm::send(mychan, val);
     }
-    for uint::range(0u, 100u) |_i| { let x = recv(myport); }
+    for uint::range(0u, 100u) |_i| { let x = core::comm::recv(myport); }
 }
 
 
 // Test rotating the buffer when the unit size is not a power of two
 fn test_rotate() {
-    let myport = Port();
-    let mychan = Chan(&myport);
+    let myport = core::comm::Port();
+    let mychan = core::comm::Chan(&myport);
     for uint::range(0u, 100u) |i| {
         let val = {val1: i as u32, val2: i as u32, val3: i as u32};
-        send(mychan, val);
-        let x = recv(myport);
+        core::comm::send(mychan, val);
+        let x = core::comm::recv(myport);
         assert (x.val1 == i as u32);
         assert (x.val2 == i as u32);
         assert (x.val3 == i as u32);
@@ -83,16 +78,16 @@ fn test_rotate() {
 // Test rotating and growing the buffer when
 // the unit size is not a power of two
 fn test_rotate_grow() {
-    let myport = Port::<record>();
-    let mychan = Chan(&myport);
+    let myport = core::comm::Port::<record>();
+    let mychan = core::comm::Chan(&myport);
     for uint::range(0u, 10u) |j| {
         for uint::range(0u, 10u) |i| {
             let val: record =
                 {val1: i as u32, val2: i as u32, val3: i as u32};
-            send(mychan, val);
+            core::comm::send(mychan, val);
         }
         for uint::range(0u, 10u) |i| {
-            let x = recv(myport);
+            let x = core::comm::recv(myport);
             assert (x.val1 == i as u32);
             assert (x.val2 == i as u32);
             assert (x.val3 == i as u32);
index 66fd68faada90c13475696b9200fc2a30e2b32a9..ed45627a3798547d1adb0e30f9ea04d00cbdb2ba 100644 (file)
@@ -10,8 +10,6 @@
 
 // Tests of the runtime's scheduler interface
 
-use ptr::is_null;
-
 type sched_id = int;
 type task_id = *libc::c_void;
 
index caa614e1a7ef45b2845c4ba78691c2d04e11b105..86e6b7f0f50fe77c66ea6a878c14faa923beb96b 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 3c7fa7cc3d4a7be0fc6dd0018277312560502712..75d526aa2c787adb96f5028ae93cc5f1202b79d9 100644 (file)
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use task::*;
-use comm::*;
-
 struct test {
   f: int,
 }
@@ -26,12 +23,12 @@ fn test(f: int) -> test {
 }
 
 fn main() {
-    let p = Port();
-    let c = Chan(&p);
+    let p = core::comm::Port();
+    let c = core::comm::Chan(&p);
 
-    do spawn() {
-        let p = Port();
-        c.send(Chan(&p));
+    do task::spawn() {
+        let p = core::comm::Port();
+        c.send(core::comm::Chan(&p));
 
         let _r = p.recv();
     }
index df21dcdda9869b08e3fc82411699b20561da0613..664ba09ae4b10fb161e327786761027ce51237f6 100644 (file)
@@ -8,16 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
-use comm::Chan;
-use comm::send;
-use comm::Port;
-
 // tests that ctrl's type gets inferred properly
 type command<K: Send, V: Send> = {key: K, val: V};
 
-fn cache_server<K: Send, V: Send>(c: Chan<Chan<command<K, V>>>) {
-    let ctrl = Port();
-    send(c, Chan(&ctrl));
+fn cache_server<K: Send, V: Send>(c: core::comm::Chan<core::comm::Chan<command<K, V>>>) {
+    let ctrl = core::comm::Port();
+    core::comm::send(c, core::comm::Chan(&ctrl));
 }
 fn main() { }
index 441adda3a232c7fab217a60f27a3a5a6355ecdef..01a480ff25d9affc9a862aabc959097113a8e23b 100644 (file)
@@ -8,11 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
-
-use comm::Chan;
-use comm::send;
-
 fn main() { test05(); }
 
 fn mk_counter<A:Copy>() -> fn~(A) -> (A,uint) {
index 5bbb001cb151d54d5c85d6d889c08668e216d9ac..504d7948ffc1592fd90be02c8c4cb9c2f590186b 100644 (file)
@@ -8,11 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
-
-use comm::Chan;
-use comm::send;
-
 fn main() { test05(); }
 
 fn test05_start(&&f: fn~(int)) {
index bfc9079c8d0feb975ebbd7983971eee70323fc8a..4139aedf88137e42cde5e72874e6e6215ad33610 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 8b67a01420c6b520bfe322155194679ce37c94e8..5ae5bbaeec90964c20c307a40cb5b9dd5d531340 100644 (file)
@@ -10,9 +10,6 @@
 // except according to those terms.
 
 
-extern mod std;
-use task::yield;
-
 fn x(s: ~str, n: int) {
     log(debug, s);
     log(debug, n);
@@ -23,5 +20,5 @@ fn main() {
     task::spawn(|| x(~"hello from second spawned fn", 66) );
     task::spawn(|| x(~"hello from third spawned fn", 67) );
     let mut i: int = 30;
-    while i > 0 { i = i - 1; debug!("parent sleeping"); yield(); }
+    while i > 0 { i = i - 1; debug!("parent sleeping"); task::yield(); }
 }
index d358d7d7986df08b2a18f62bffe0dc3a801ac4e6..fb3dc1ff74100c2bd444ddbe173d646f2fd47f81 100644 (file)
@@ -9,11 +9,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-extern mod std;
-use task::spawn;
-
-fn main() { spawn(|| child((10, 20, 30, 40, 50, 60, 70, 80, 90)) ); }
+fn main() { task::spawn(|| child((10, 20, 30, 40, 50, 60, 70, 80, 90)) ); }
 
 fn child(&&args: (int, int, int, int, int, int, int, int, int)) {
     let (i1, i2, i3, i4, i5, i6, i7, i8, i9) = args;
index 31a9c2ff69804ffdb6d1134194874e9513561171..ff4f5bfe62fb344a6c66646b53b2c775562436c0 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index dcfc6fed207174662885431ef1ae3464e7a6d0b4..767887319470df517e14f983de0316b8489f4929 100644 (file)
@@ -10,7 +10,6 @@
 // except according to those terms.
 
 
-extern mod std;
 use pipes::send;
 use pipes::Port;
 use pipes::recv;
index 3f42b4d5b57f89240e4c436f3b5a11a7bc4c8a20..dc82ae214dcd466e64159a08ab91e31718653848 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
 use pipes::send;
 
 fn main() { test00(); }
index 41e24146635a820d6d67cd347dd4f042fe4be003..cad0f4f1ddeec9645f804e0712df3882d27dd13c 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
 use pipes::send;
 use pipes::Chan;
 use pipes::recv;
index 3f316f8c5f32717122f0a1d7ff0d1720f2573646..5147c2ba6e49179785a8f08ce4a32ac19e764b5b 100644 (file)
@@ -8,14 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
-
-use task::task;
-use comm::Chan;
-use comm::Port;
-use comm::send;
-use comm::recv;
-
 fn main() {
     test00();
     // test01();
@@ -25,12 +17,12 @@ fn main() {
     test06();
 }
 
-fn test00_start(ch: Chan<int>, message: int, count: int) {
+fn test00_start(ch: core::comm::Chan<int>, message: int, count: int) {
     debug!("Starting test00_start");
     let mut i: int = 0;
     while i < count {
         debug!("Sending Message");
-        send(ch, message + 0);
+        core::comm::send(ch, message + 0);
         i = i + 1;
     }
     debug!("Ending test00_start");
@@ -41,8 +33,8 @@ fn test00() {
     let number_of_messages: int = 4;
     debug!("Creating tasks");
 
-    let po = Port();
-    let ch = Chan(&po);
+    let po = core::comm::Port();
+    let ch = core::comm::Chan(&po);
 
     let mut i: int = 0;
 
@@ -58,7 +50,7 @@ fn test00() {
     let mut sum: int = 0;
     for results.each |r| {
         i = 0;
-        while i < number_of_messages { sum += recv(po); i = i + 1; }
+        while i < number_of_messages { sum += core::comm::recv(po); i = i + 1; }
     }
 
     for results.each |r| { r.recv(); }
@@ -71,19 +63,19 @@ fn test00() {
 }
 
 fn test01() {
-    let p = Port();
+    let p = core::comm::Port();
     debug!("Reading from a port that is never written to.");
-    let value: int = recv(p);
+    let value: int = core::comm::recv(p);
     log(debug, value);
 }
 
 fn test02() {
-    let p = Port();
-    let c = Chan(&p);
+    let p = core::comm::Port();
+    let c = core::comm::Chan(&p);
     debug!("Writing to a local task channel.");
-    send(c, 42);
+    core::comm::send(c, 42);
     debug!("Reading from a local task port.");
-    let value: int = recv(p);
+    let value: int = core::comm::recv(p);
     log(debug, value);
 }
 
@@ -101,22 +93,22 @@ fn test04() {
     debug!("Finishing up.");
 }
 
-fn test05_start(ch: Chan<int>) {
-    send(ch, 10);
-    send(ch, 20);
-    send(ch, 30);
-    send(ch, 30);
-    send(ch, 30);
+fn test05_start(ch: core::comm::Chan<int>) {
+    core::comm::send(ch, 10);
+    core::comm::send(ch, 20);
+    core::comm::send(ch, 30);
+    core::comm::send(ch, 30);
+    core::comm::send(ch, 30);
 }
 
 fn test05() {
-    let po = comm::Port();
-    let ch = Chan(&po);
+    let po = core::comm::Port();
+    let ch = core::comm::Chan(&po);
     task::spawn(|| test05_start(ch) );
     let mut value: int;
-    value = recv(po);
-    value = recv(po);
-    value = recv(po);
+    value = core::comm::recv(po);
+    value = core::comm::recv(po);
+    value = core::comm::recv(po);
     log(debug, value);
 }
 
index c69886b7cadc549f752848d125cf70da2b320f35..2fe24a7b38e33c0bca7d46c0656c4a3cbf41899a 100644 (file)
@@ -13,8 +13,6 @@
 // A port of task-killjoin to use a class with a dtor to manage
 // the join.
 
-extern mod std;
-
 struct notify {
     ch: comm::Chan<bool>, v: @mut bool,
 }
index f1e99924108f58a83877f662572f08d5bdf3af76..7ef94afa54fdd9d735f9b53ec7af7d0082a73046 100644 (file)
@@ -15,8 +15,6 @@
 // task will kill the supervising task, waking it up. The supervising task no
 // longer needs to be wakened when the supervised task exits.
 
-extern mod std;
-
 fn supervised() {
     // Yield to make sure the supervisor joins before we fail. This is
     // currently not needed because the supervisor runs first, but I can
index 63f88180d0ee1863470146cb0bbf0736b3a4a8fa..52785ed12d40ad4f43f1d0617183e200577199b1 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index eb79cfb53a41ab457d44f7b2ffbd5c15668bafc8..43077a7b2e60765e554b985c600087f451cbcace 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index e0ed5491f04021b3497c4a99dcb2cb9c866bc3bc..ae72fce4f94d0efe98b84909ed258c56a13934b5 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
@@ -103,4 +105,4 @@ fn test_float_ext<T:FloatExt>(n: T) { io::println(fmt!("%?", n < n)) }
 
 fn main() {
     test_float_ext(1f32);
-}
\ No newline at end of file
+}
index 67832810d8618fbf5be6a2d756bdc93fc5056e5a..2d3bb42ad4c7654964974454dabc439463d0c206 100644 (file)
@@ -8,15 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
-use sys::refcount;
-
 fn main() unsafe {
     let i = ~@1;
     let j = ~@2;
-    let rc1 = refcount(*i);
+    let rc1 = sys::refcount(*i);
     let j = copy i;
-    let rc2 = refcount(*i);
+    let rc2 = sys::refcount(*i);
     error!("rc1: %u rc2: %u", rc1, rc2);
     assert rc1 + 1u == rc2;
 }
index 086bf4fed53b0ef1db3c0e7c987dee31420246ee..dc09d6b44487f9abfcf550dffa471adea1bf8261 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 94d320775a1bd0d6dfc8503bb8cc3a9297965271..d58c168e7cd3262cdf9a3391e683c052d316d9b6 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-fast
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
@@ -22,4 +24,4 @@ mod baz {
     use x = core::str;
 }
 
-fn main() { }
\ No newline at end of file
+fn main() { }
index b19cf183b352cb2ff96f2d4530851906dbb97c87..2d73e67213185042522d8accfd6f131de96efdec 100644 (file)
@@ -9,20 +9,17 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
-use task::*;
-
 fn main() {
     let mut result = None;
     task::task().future_result(|+r| { result = Some(move r); }).spawn(child);
     error!("1");
-    yield();
+    task::yield();
     error!("2");
-    yield();
+    task::yield();
     error!("3");
     option::unwrap(move result).recv();
 }
 
 fn child() {
-    error!("4"); yield(); error!("5"); yield(); error!("6");
+    error!("4"); task::yield(); error!("5"); task::yield(); error!("6");
 }
index ce0f9cefde0ccc1a06d9dc7d94b8dce14039a830..34e2f7b3c5d736e1692f53cab745edf41ea3ead0 100644 (file)
@@ -9,14 +9,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
-use task::*;
-
 fn main() {
     let mut result = None;
     task::task().future_result(|+r| { result = Some(move r); }).spawn(child);
     error!("1");
-    yield();
+    task::yield();
     option::unwrap(move result).recv();
 }
 
index 3d5a326815e299d1edc787a639bffb1e05739a4f..85a8befd3baa0cb34e724a843b4ba9df7810832e 100644 (file)
@@ -9,8 +9,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
-
 fn main() {
     let mut i: int = 0;
     while i < 100 { i = i + 1; log(error, i); task::yield(); }
index eef2a414bb6aae9e7aa2a616dc6e0b988fa3a448..c5a3c8baa3dabbdd7f3addf4b405f044db698e9c 100644 (file)
@@ -10,7 +10,6 @@
 
 // In this case, the code should compile and should
 // succeed at runtime
-extern mod std;
 use vec::{head, is_not_empty, last, same_length, zip};
 
 fn enum_chars(start: u8, end: u8) -> ~[char] {