diff --git a/src/libcore/core.rs b/src/libcore/core.rs new file mode 100644 index 000000000000..48e7a5f64cab --- /dev/null +++ b/src/libcore/core.rs @@ -0,0 +1,17 @@ +// Top-level, visible-everywhere definitions. + +// Export type option as a synonym for option::t and export the some and none +// tag constructors. + +import option::{some, none}; +import option = option::t; +export option, some, none; + +// Export the log levels as global constants. Higher levels mean +// more-verbosity. Error is the bottom level, default logging level is +// warn-and-below. + +const error : int = 0; +const warn : int = 1; +const info : int = 2; +const debug : int = 3; diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs index c7c76535846d..74d40f1c05db 100644 --- a/src/libstd/treemap.rs +++ b/src/libstd/treemap.rs @@ -9,9 +9,8 @@ red-black tree or something else. */ -import core::option; -import option::{some, none}; -import option = option::t; +import core::option::{some, none}; +import option = core::option::t; export treemap; export init; diff --git a/src/test/run-fail/alt-bot-fail.rs b/src/test/run-fail/alt-bot-fail.rs index 1a4155574f89..8b39450be866 100644 --- a/src/test/run-fail/alt-bot-fail.rs +++ b/src/test/run-fail/alt-bot-fail.rs @@ -1,8 +1,4 @@ - - // error-pattern:explicit failure -use std; -import option::*; fn foo(s: str) { } diff --git a/src/test/run-pass/alt-bot.rs b/src/test/run-pass/alt-bot.rs index 27389ebdd238..47340e04735c 100644 --- a/src/test/run-pass/alt-bot.rs +++ b/src/test/run-pass/alt-bot.rs @@ -1,5 +1,3 @@ -use std; -import option::*; fn main() { let i: int = diff --git a/src/test/run-pass/check-pattern-bound.rs b/src/test/run-pass/check-pattern-bound.rs index ad820c3c683b..fe8a650afe21 100644 --- a/src/test/run-pass/check-pattern-bound.rs +++ b/src/test/run-pass/check-pattern-bound.rs @@ -1,5 +1,4 @@ use std; -import option::*; pure fn p(x: int) -> bool { true } diff --git a/src/test/run-pass/nested-alts.rs b/src/test/run-pass/nested-alts.rs index 9ca73209f36c..d10b4f05693f 100644 --- a/src/test/run-pass/nested-alts.rs +++ b/src/test/run-pass/nested-alts.rs @@ -1,7 +1,4 @@ -use std; -import option::*; - fn baz() -> ! { fail; } fn foo() { diff --git a/src/test/run-pass/pattern-bound-var-in-for-each.rs b/src/test/run-pass/pattern-bound-var-in-for-each.rs index d09f04cc92f3..3ce13edc15e0 100644 --- a/src/test/run-pass/pattern-bound-var-in-for-each.rs +++ b/src/test/run-pass/pattern-bound-var-in-for-each.rs @@ -1,13 +1,9 @@ // Tests that trans_path checks whether a // pattern-bound var is an upvar (when translating // the for-each body) -use std; -import option::*; -import uint; fn foo(src: uint) { - alt some(src) { some(src_id) { uint::range(0u, 10u) {|i|