Skip to content

Commit a24c19e

Browse files
committed
Add companion-module core.rs that exports log levels and option/some/none everywhere.
1 parent 8bde865 commit a24c19e

File tree

7 files changed

+19
-17
lines changed

7 files changed

+19
-17
lines changed

src/libcore/core.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Top-level, visible-everywhere definitions.
2+
3+
// Export type option as a synonym for option::t and export the some and none
4+
// tag constructors.
5+
6+
import option::{some, none};
7+
import option = option::t;
8+
export option, some, none;
9+
10+
// Export the log levels as global constants. Higher levels mean
11+
// more-verbosity. Error is the bottom level, default logging level is
12+
// warn-and-below.
13+
14+
const error : int = 0;
15+
const warn : int = 1;
16+
const info : int = 2;
17+
const debug : int = 3;

src/libstd/treemap.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ red-black tree or something else.
99
1010
*/
1111

12-
import core::option;
13-
import option::{some, none};
14-
import option = option::t;
12+
import core::option::{some, none};
13+
import option = core::option::t;
1514

1615
export treemap;
1716
export init;

src/test/run-fail/alt-bot-fail.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
2-
31
// error-pattern:explicit failure
4-
use std;
5-
import option::*;
62

73
fn foo(s: str) { }
84

src/test/run-pass/alt-bot.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std;
2-
import option::*;
31

42
fn main() {
53
let i: int =

src/test/run-pass/check-pattern-bound.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std;
2-
import option::*;
32

43
pure fn p(x: int) -> bool { true }
54

src/test/run-pass/nested-alts.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11

2-
use std;
3-
import option::*;
4-
52
fn baz() -> ! { fail; }
63

74
fn foo() {

src/test/run-pass/pattern-bound-var-in-for-each.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
// Tests that trans_path checks whether a
22
// pattern-bound var is an upvar (when translating
33
// the for-each body)
4-
use std;
5-
import option::*;
6-
import uint;
74

85
fn foo(src: uint) {
96

10-
117
alt some(src) {
128
some(src_id) {
139
uint::range(0u, 10u) {|i|

0 commit comments

Comments
 (0)