about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2012-09-28 16:24:57 -0700
committerGraydon Hoare <graydon@mozilla.com>2012-09-28 16:26:33 -0700
commite17d998e9530ee5a9da37f98dab2e33ad6a1d0f9 (patch)
treec98faef1fa8f53c366127e642b7a2cf82e583166 /src/libstd
parent1948ddf583fd958a54599d7e06dc3098e563c03f (diff)
downloadrust-e17d998e9530ee5a9da37f98dab2e33ad6a1d0f9.tar.gz
rust-e17d998e9530ee5a9da37f98dab2e33ad6a1d0f9.zip
De-export std::{time, prettyprint{,2}, arena}. Part of #3583.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/arena.rs10
-rw-r--r--src/libstd/prettyprint2.rs4
-rw-r--r--src/libstd/std.rc4
-rw-r--r--src/libstd/time.rs38
4 files changed, 17 insertions, 39 deletions
diff --git a/src/libstd/arena.rs b/src/libstd/arena.rs
index de3c5774bfe..4d2b910fa85 100644
--- a/src/libstd/arena.rs
+++ b/src/libstd/arena.rs
@@ -24,8 +24,6 @@
 
 #[forbid(deprecated_mode)];
 
-export Arena, arena_with_size;
-
 use list::{List, Cons, Nil};
 use cast::reinterpret_cast;
 use sys::TypeDesc;
@@ -33,12 +31,10 @@ use libc::size_t;
 
 #[abi = "rust-intrinsic"]
 extern mod rusti {
-    #[legacy_exports];
     fn move_val_init<T>(&dst: T, -src: T);
     fn needs_drop<T>() -> bool;
 }
 extern mod rustrt {
-    #[legacy_exports];
     #[rust_stack]
     fn rust_call_tydesc_glue(root: *u8, tydesc: *TypeDesc, field: size_t);
 }
@@ -51,7 +47,7 @@ const tydesc_drop_glue_index: size_t = 3 as size_t;
 // will always stay at 0.
 type Chunk = {data: @[u8], mut fill: uint, is_pod: bool};
 
-struct Arena {
+pub struct Arena {
     // The head is seperated out from the list as a unbenchmarked
     // microoptimization, to avoid needing to case on the list to
     // access the head.
@@ -74,13 +70,13 @@ fn chunk(size: uint, is_pod: bool) -> Chunk {
     { data: unsafe { cast::transmute(v) }, mut fill: 0u, is_pod: is_pod }
 }
 
-fn arena_with_size(initial_size: uint) -> Arena {
+pub fn arena_with_size(initial_size: uint) -> Arena {
     return Arena {mut head: chunk(initial_size, false),
                   mut pod_head: chunk(initial_size, true),
                   mut chunks: @Nil};
 }
 
-fn Arena() -> Arena {
+pub fn Arena() -> Arena {
     arena_with_size(32u)
 }
 
diff --git a/src/libstd/prettyprint2.rs b/src/libstd/prettyprint2.rs
index 325d240eb57..68421a217ee 100644
--- a/src/libstd/prettyprint2.rs
+++ b/src/libstd/prettyprint2.rs
@@ -4,11 +4,11 @@ use io::Writer;
 use io::WriterUtil;
 use serialization2;
 
-struct Serializer {
+pub struct Serializer {
     wr: io::Writer,
 }
 
-fn Serializer(wr: io::Writer) -> Serializer {
+pub fn Serializer(wr: io::Writer) -> Serializer {
     Serializer { wr: wr }
 }
 
diff --git a/src/libstd/std.rc b/src/libstd/std.rc
index faca45fa6f7..cf2e1d6567f 100644
--- a/src/libstd/std.rc
+++ b/src/libstd/std.rc
@@ -111,13 +111,9 @@ mod sha1;
 mod md4;
 mod tempfile;
 mod term;
-#[legacy_exports]
 mod time;
-#[legacy_exports]
 mod prettyprint;
-#[legacy_exports]
 mod prettyprint2;
-#[legacy_exports]
 mod arena;
 mod par;
 mod cmp;
diff --git a/src/libstd/time.rs b/src/libstd/time.rs
index 9f6f9b07737..43cbc6da9bd 100644
--- a/src/libstd/time.rs
+++ b/src/libstd/time.rs
@@ -5,20 +5,6 @@ use libc::{c_char, c_int, c_long, size_t, time_t};
 use io::{Reader, ReaderUtil};
 use result::{Result, Ok, Err};
 
-export
-    Timespec,
-    get_time,
-    precise_time_ns,
-    precise_time_s,
-    tzset,
-    Tm,
-    empty_tm,
-    now,
-    at,
-    now_utc,
-    at_utc,
-    strptime;
-
 #[abi = "cdecl"]
 extern mod rustrt {
     #[legacy_exports];
@@ -34,7 +20,7 @@ extern mod rustrt {
 }
 
 /// A record specifying a time value in seconds and nanoseconds.
-type Timespec = {sec: i64, nsec: i32};
+pub type Timespec = {sec: i64, nsec: i32};
 
 impl Timespec : Eq {
     pure fn eq(other: &Timespec) -> bool {
@@ -47,7 +33,7 @@ impl Timespec : Eq {
  * Returns the current time as a `timespec` containing the seconds and
  * nanoseconds since 1970-01-01T00:00:00Z.
  */
-fn get_time() -> Timespec {
+pub fn get_time() -> Timespec {
     let mut sec = 0i64;
     let mut nsec = 0i32;
     rustrt::get_time(sec, nsec);
@@ -58,7 +44,7 @@ fn get_time() -> Timespec {
  * Returns the current value of a high-resolution performance counter
  * in nanoseconds since an unspecified epoch.
  */
-fn precise_time_ns() -> u64 {
+pub fn precise_time_ns() -> u64 {
     let mut ns = 0u64;
     rustrt::precise_time_ns(ns);
     ns
@@ -68,11 +54,11 @@ fn precise_time_ns() -> u64 {
  * Returns the current value of a high-resolution performance counter
  * in seconds since an unspecified epoch.
  */
-fn precise_time_s() -> float {
+pub fn precise_time_s() -> float {
     return (precise_time_ns() as float) / 1000000000.;
 }
 
-fn tzset() {
+pub fn tzset() {
     rustrt::rust_tzset();
 }
 
@@ -109,7 +95,7 @@ impl Tm_ : Eq {
     pure fn ne(other: &Tm_) -> bool { !self.eq(other) }
 }
 
-enum Tm {
+pub enum Tm {
     Tm_(Tm_)
 }
 
@@ -118,7 +104,7 @@ impl Tm : Eq {
     pure fn ne(other: &Tm) -> bool { *self != *(*other) }
 }
 
-fn empty_tm() -> Tm {
+pub fn empty_tm() -> Tm {
     Tm_({
         tm_sec: 0_i32,
         tm_min: 0_i32,
@@ -136,7 +122,7 @@ fn empty_tm() -> Tm {
 }
 
 /// Returns the specified time in UTC
-fn at_utc(clock: Timespec) -> Tm {
+pub fn at_utc(clock: Timespec) -> Tm {
     let mut {sec, nsec} = clock;
     let mut tm = empty_tm();
     rustrt::rust_gmtime(sec, nsec, tm);
@@ -144,12 +130,12 @@ fn at_utc(clock: Timespec) -> Tm {
 }
 
 /// Returns the current time in UTC
-fn now_utc() -> Tm {
+pub fn now_utc() -> Tm {
     at_utc(get_time())
 }
 
 /// Returns the specified time in the local timezone
-fn at(clock: Timespec) -> Tm {
+pub fn at(clock: Timespec) -> Tm {
     let mut {sec, nsec} = clock;
     let mut tm = empty_tm();
     rustrt::rust_localtime(sec, nsec, tm);
@@ -157,12 +143,12 @@ fn at(clock: Timespec) -> Tm {
 }
 
 /// Returns the current time in the local timezone
-fn now() -> Tm {
+pub fn now() -> Tm {
     at(get_time())
 }
 
 /// Parses the time from the string according to the format string.
-fn strptime(s: &str, format: &str) -> Result<Tm, ~str> {
+pub fn strptime(s: &str, format: &str) -> Result<Tm, ~str> {
     type TmMut = {
        mut tm_sec: i32,
        mut tm_min: i32,