diff --git a/src/libcore/core.rc b/src/libcore/core.rc index d37fdb1a679..5a09c595bd6 100644 --- a/src/libcore/core.rc +++ b/src/libcore/core.rc @@ -188,7 +188,6 @@ mod hash; mod either; #[legacy_exports] mod iter; -#[legacy_exports] mod logging; #[legacy_exports] mod option; @@ -201,13 +200,9 @@ mod option_iter { } #[legacy_exports] mod result; -#[legacy_exports] mod to_str; -#[legacy_exports] mod to_bytes; -#[legacy_exports] mod from_str; -#[legacy_exports] mod util; // Data structure modules diff --git a/src/libcore/from_str.rs b/src/libcore/from_str.rs index b9bd322a816..c4dd2536e2c 100644 --- a/src/libcore/from_str.rs +++ b/src/libcore/from_str.rs @@ -6,7 +6,7 @@ use option::Option; -trait FromStr { +pub trait FromStr { static fn from_str(s: &str) -> Option; } diff --git a/src/libcore/logging.rs b/src/libcore/logging.rs index cd7321bf0d3..d4f3c0ea272 100644 --- a/src/libcore/logging.rs +++ b/src/libcore/logging.rs @@ -8,7 +8,6 @@ use cast::transmute; #[nolink] extern mod rustrt { - #[legacy_exports]; fn rust_log_console_on(); fn rust_log_console_off(); fn rust_log_str(level: u32, string: *libc::c_char, size: libc::size_t); diff --git a/src/libcore/to_bytes.rs b/src/libcore/to_bytes.rs index 69b5974b558..ef15aa00f11 100644 --- a/src/libcore/to_bytes.rs +++ b/src/libcore/to_bytes.rs @@ -10,7 +10,7 @@ The `ToBytes` and `IterBytes` traits use io::Writer; -type Cb = fn(buf: &[const u8]) -> bool; +pub type Cb = fn(buf: &[const u8]) -> bool; /** * A trait to implement in order to make a type hashable; @@ -19,7 +19,7 @@ type Cb = fn(buf: &[const u8]) -> bool; * modified when default methods and trait inheritence are * completed. */ -trait IterBytes { +pub trait IterBytes { /** * Call the provided callback `f` one or more times with * byte-slices that should be used when computing a hash @@ -211,7 +211,7 @@ impl @[A]: IterBytes { } } -pure fn iter_bytes_2(a: &A, b: &B, +pub pure fn iter_bytes_2(a: &A, b: &B, lsb0: bool, z: Cb) { let mut flag = true; a.iter_bytes(lsb0, |bytes| {flag = z(bytes); flag}); @@ -219,7 +219,7 @@ pure fn iter_bytes_2(a: &A, b: &B, b.iter_bytes(lsb0, |bytes| {flag = z(bytes); flag}); } -pure fn iter_bytes_3(a: &A, b: &B, c: &C, lsb0: bool, z: Cb) { @@ -231,7 +231,7 @@ pure fn iter_bytes_3(a: &A, b: &B, c: &C, @@ -247,7 +247,7 @@ pure fn iter_bytes_4 ~str; } +pub trait ToStr { fn to_str() -> ~str; } impl int: ToStr { fn to_str() -> ~str { int::str(self) } @@ -101,7 +101,6 @@ impl ~A: ToStr { #[cfg(test)] #[allow(non_implicitly_copyable_typarams)] mod tests { - #[legacy_exports]; #[test] fn test_simple_types() { assert 1.to_str() == ~"1"; diff --git a/src/libcore/util.rs b/src/libcore/util.rs index 8c38949f5df..9ba8b52f5da 100644 --- a/src/libcore/util.rs +++ b/src/libcore/util.rs @@ -12,16 +12,16 @@ use cmp::Eq; /// The identity function. #[inline(always)] -pure fn id(+x: T) -> T { move x } +pub pure fn id(+x: T) -> T { move x } /// Ignores a value. #[inline(always)] -pure fn ignore(+_x: T) { } +pub pure fn ignore(+_x: T) { } /// Sets `*ptr` to `new_value`, invokes `op()`, and then restores the /// original value of `*ptr`. #[inline(always)] -fn with( +pub fn with( ptr: &mut T, +new_value: T, op: &fn() -> R) -> R @@ -41,7 +41,7 @@ fn with( * deinitialising or copying either one. */ #[inline(always)] -fn swap(x: &mut T, y: &mut T) { +pub fn swap(x: &mut T, y: &mut T) { *x <-> *y; } @@ -50,19 +50,19 @@ fn swap(x: &mut T, y: &mut T) { * value, without deinitialising or copying either one. */ #[inline(always)] -fn replace(dest: &mut T, +src: T) -> T { +pub fn replace(dest: &mut T, +src: T) -> T { let mut tmp <- src; swap(dest, &mut tmp); move tmp } /// A non-copyable dummy type. -struct NonCopyable { +pub struct NonCopyable { i: (), drop { } } -fn NonCopyable() -> NonCopyable { NonCopyable { i: () } } +pub fn NonCopyable() -> NonCopyable { NonCopyable { i: () } } /** A utility function for indicating unreachable code. It will fail if @@ -88,7 +88,7 @@ fn choose_weighted_item(v: &[Item]) -> Item { ~~~ */ -fn unreachable() -> ! { +pub fn unreachable() -> ! { fail ~"internal error: entered unreachable code"; }