Add companion-module core.rs that exports log levels and option/some/none everywhere.
This commit is contained in:
parent
8bde865d09
commit
a24c19e867
7 changed files with 19 additions and 17 deletions
17
src/libcore/core.rs
Normal file
17
src/libcore/core.rs
Normal file
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
|
||||
|
||||
// error-pattern:explicit failure
|
||||
use std;
|
||||
import option::*;
|
||||
|
||||
fn foo(s: str) { }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
use std;
|
||||
import option::*;
|
||||
|
||||
fn main() {
|
||||
let i: int =
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
use std;
|
||||
import option::*;
|
||||
|
||||
pure fn p(x: int) -> bool { true }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
use std;
|
||||
import option::*;
|
||||
|
||||
fn baz() -> ! { fail; }
|
||||
|
||||
fn foo() {
|
||||
|
|
|
|||
|
|
@ -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|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue