about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/ebml.rs1
-rw-r--r--src/libstd/fs.rs2
-rw-r--r--src/libstd/generic_os.rs1
-rw-r--r--src/libstd/getopts.rs1
-rw-r--r--src/libstd/io.rs2
-rw-r--r--src/libstd/json.rs2
-rw-r--r--src/libstd/linux_os.rs1
-rw-r--r--src/libstd/list.rs2
-rw-r--r--src/libstd/macos_os.rs1
-rw-r--r--src/libstd/map.rs28
-rw-r--r--src/libstd/rope.rs3
-rw-r--r--src/libstd/run_program.rs1
-rw-r--r--src/libstd/smallintmap.rs3
-rw-r--r--src/libstd/str.rs16
-rw-r--r--src/libstd/task.rs11
-rw-r--r--src/libstd/tempfile.rs2
-rw-r--r--src/libstd/term.rs2
-rw-r--r--src/libstd/test.rs5
-rw-r--r--src/libstd/treemap.rs1
-rw-r--r--src/libstd/ufind.rs1
-rw-r--r--src/libstd/vec.rs1
-rw-r--r--src/libstd/win32_os.rs1
22 files changed, 59 insertions, 29 deletions
diff --git a/src/libstd/ebml.rs b/src/libstd/ebml.rs
index 4a49dd473f4..4448ee79d19 100644
--- a/src/libstd/ebml.rs
+++ b/src/libstd/ebml.rs
@@ -3,6 +3,7 @@
 // Simple Extensible Binary Markup Language (ebml) reader and writer on a
 // cursor model. See the specification here:
 //     http://www.matroska.org/technical/specs/rfc/index.html
+import core::option;
 import option::{some, none};
 
 type ebml_tag = {id: uint, size: uint};
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs
index fcd95040ab0..7175df40a16 100644
--- a/src/libstd/fs.rs
+++ b/src/libstd/fs.rs
@@ -4,6 +4,8 @@ Module: fs
 File system manipulation
 */
 
+import core::vec;
+import core::option;
 import os;
 import os::getcwd;
 import os_fs;
diff --git a/src/libstd/generic_os.rs b/src/libstd/generic_os.rs
index bbbd76f8217..babfd0281ba 100644
--- a/src/libstd/generic_os.rs
+++ b/src/libstd/generic_os.rs
@@ -6,6 +6,7 @@ Some miscellaneous platform functions.
 These should be rolled into another module.
 */
 
+import core::option;
 
 // Wow, this is an ugly way to write doc comments
 
diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs
index 438bec0a90b..115bcca8174 100644
--- a/src/libstd/getopts.rs
+++ b/src/libstd/getopts.rs
@@ -45,6 +45,7 @@ name following -o, and accepts both -h and --help as optional flags.
 
 */
 
+import core::option;
 import option::{some, none};
 export opt;
 export reqopt;
diff --git a/src/libstd/io.rs b/src/libstd/io.rs
index 06e1be2fc4b..53dd5de3ab3 100644
--- a/src/libstd/io.rs
+++ b/src/libstd/io.rs
@@ -4,6 +4,8 @@ Module: io
 Basic input/output
 */
 
+import core::option;
+import core::result;
 import ctypes::fd_t;
 import ctypes::c_int;
 
diff --git a/src/libstd/json.rs b/src/libstd/json.rs
index 3f74c55507b..bdd8547e84e 100644
--- a/src/libstd/json.rs
+++ b/src/libstd/json.rs
@@ -3,7 +3,7 @@
 
 import float;
 import map;
-import option;
+import core::option;
 import option::{some, none};
 import str;
 import vec;
diff --git a/src/libstd/linux_os.rs b/src/libstd/linux_os.rs
index 7e30088ee3c..8528057ed98 100644
--- a/src/libstd/linux_os.rs
+++ b/src/libstd/linux_os.rs
@@ -4,6 +4,7 @@ Module: os
 TODO: Restructure and document
 */
 
+import core::option;
 import ctypes::*;
 
 export libc;
diff --git a/src/libstd/list.rs b/src/libstd/list.rs
index ab712091819..d0c7582426a 100644
--- a/src/libstd/list.rs
+++ b/src/libstd/list.rs
@@ -4,6 +4,8 @@ Module: list
 A standard linked list
 */
 
+import core::option;
+import option::*;
 import option::{some, none};
 
 /* Section: Types */
diff --git a/src/libstd/macos_os.rs b/src/libstd/macos_os.rs
index f23e82eaa63..72afcc234b3 100644
--- a/src/libstd/macos_os.rs
+++ b/src/libstd/macos_os.rs
@@ -1,3 +1,4 @@
+import core::option;
 import ctypes::*;
 
 export libc;
diff --git a/src/libstd/map.rs b/src/libstd/map.rs
index dd9d939a20e..a07a9f9a1a2 100644
--- a/src/libstd/map.rs
+++ b/src/libstd/map.rs
@@ -72,14 +72,14 @@ type hashmap<K, V> = obj {
     Get the value for the specified key. If the key does not exist
     in the map then returns none.
     */
-    fn find(K) -> option::t<V>;
+    fn find(K) -> core::option::t<V>;
     /*
     Method: remove
 
     Remove and return a value from the map. If the key does not exist
     in the map then returns none.
     */
-    fn remove(K) -> option::t<V>;
+    fn remove(K) -> core::option::t<V>;
     /*
     Method: rehash
 
@@ -210,38 +210,38 @@ mod chained {
         }
     }
 
-    fn get<copy K, copy V>(tbl: t<K,V>, k: K) -> option::t<V> {
+    fn get<copy K, copy V>(tbl: t<K,V>, k: K) -> core::option::t<V> {
         alt search_tbl(tbl, k, tbl.hasher(k)) {
           not_found. {
-            ret option::none;
+            ret core::option::none;
           }
 
           found_first(_, entry) {
-            ret option::some(entry.value);
+            ret core::option::some(entry.value);
           }
 
           found_after(_, entry) {
-            ret option::some(entry.value);
+            ret core::option::some(entry.value);
           }
         }
     }
 
-    fn remove<copy K, copy V>(tbl: t<K,V>, k: K) -> option::t<V> {
+    fn remove<copy K, copy V>(tbl: t<K,V>, k: K) -> core::option::t<V> {
         alt search_tbl(tbl, k, tbl.hasher(k)) {
           not_found. {
-            ret option::none;
+            ret core::option::none;
           }
 
           found_first(idx, entry) {
             tbl.size -= 1u;
             tbl.chains[idx] = entry.next;
-            ret option::some(entry.value);
+            ret core::option::some(entry.value);
           }
 
           found_after(eprev, entry) {
             tbl.size -= 1u;
             eprev.next = entry.next;
-            ret option::some(entry.value);
+            ret core::option::some(entry.value);
           }
         }
     }
@@ -311,18 +311,18 @@ mod chained {
         }
 
         fn contains_key(k: K) -> bool {
-            ret option::is_some(get(*tbl, k));
+            ret core::option::is_some(get(*tbl, k));
         }
 
         fn get(k: K) -> V {
-            ret option::get(get(*tbl, k));
+            ret core::option::get(get(*tbl, k));
         }
 
-        fn find(k: K) -> option::t<V> {
+        fn find(k: K) -> core::option::t<V> {
             ret get(*tbl, k);
         }
 
-        fn remove(k: K) -> option::t<V> {
+        fn remove(k: K) -> core::option::t<V> {
             ret remove(*tbl, k);
         }
 
diff --git a/src/libstd/rope.rs b/src/libstd/rope.rs
index 19819a968bf..2872aa6c4f6 100644
--- a/src/libstd/rope.rs
+++ b/src/libstd/rope.rs
@@ -26,6 +26,8 @@ The following operations are algorithmically faster in ropes:
  */
 
 
+import core::option;
+
 
 
 /*
@@ -211,7 +213,6 @@ Section: Keeping ropes healthy
  */
 
 
-
 /*
 Function: bal
 
diff --git a/src/libstd/run_program.rs b/src/libstd/run_program.rs
index 6f4ad2da3d6..ca4763ca7e2 100644
--- a/src/libstd/run_program.rs
+++ b/src/libstd/run_program.rs
@@ -3,6 +3,7 @@ Module: run
 
 Process spawning
 */
+import core::option;
 import str::sbuf;
 import ctypes::{fd_t, pid_t};
 
diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs
index 4702a2adab4..d57f553b68f 100644
--- a/src/libstd/smallintmap.rs
+++ b/src/libstd/smallintmap.rs
@@ -4,7 +4,8 @@ Module: smallintmap
 A simple map based on a vector for small integer keys. Space requirements
 are O(highest integer key).
 */
-import option::{some, none};
+import core::option;
+import core::option::{some, none};
 
 // FIXME: Should not be @; there's a bug somewhere in rustc that requires this
 // to be.
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index 7a9d3396c1b..fe2e7d9c567 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -938,15 +938,13 @@ Escapes a single character.
 */
 fn escape_char(c: char) -> str {
     alt c {
-        '"' { "\\\"" }
-        '\\' { "\\\\" }
-// TODO: uncomment these when https://github.com/graydon/rust/issues/1170 is
-// fixed.
-//        '\n' { "\\n" }
-//        '\t' { "\\t" }
-//        '\r' { "\\r" }
-        '\x00' to '\x1f' { #fmt["\\x%02x", c as uint] }
-        v { from_char(c) }
+      '"' { "\\\"" }
+      '\\' { "\\\\" }
+      '\n' { "\\n" }
+      '\t' { "\\t" }
+      '\r' { "\\r" }
+      '\x00' to '\x1f' { #fmt["\\x%02x", c as uint] }
+      v { from_char(c) }
     }
 }
 
diff --git a/src/libstd/task.rs b/src/libstd/task.rs
index 3e396d3ac63..31f01cf8384 100644
--- a/src/libstd/task.rs
+++ b/src/libstd/task.rs
@@ -146,7 +146,9 @@ time_in_us - maximum number of microseconds to yield control for
 fn sleep(time_in_us: uint) {
     let task = rustrt::rust_get_task();
     let killed = false;
-    log #fmt("yielding for %u us", time_in_us);
+    // FIXME: uncomment this when extfmt is moved to core
+    // in a snapshot.
+    // log #fmt("yielding for %u us", time_in_us);
     rusti::task_sleep(task, time_in_us, killed);
     if killed {
         fail "killed";
@@ -181,7 +183,12 @@ fn join(task_port: joinable_task) -> task_result {
       exit(_id, res) {
         if _id == id {
             ret res
-        } else { fail #fmt["join received id %d, expected %d", _id, id] }
+        } else {
+            // FIXME: uncomment this when extfmt is moved to core
+            // in a snapshot.
+            // fail #fmt["join received id %d, expected %d", _id, id]
+            fail;
+        }
       }
     }
 }
diff --git a/src/libstd/tempfile.rs b/src/libstd/tempfile.rs
index ee7d5e3b2d9..4d6adedfe18 100644
--- a/src/libstd/tempfile.rs
+++ b/src/libstd/tempfile.rs
@@ -4,8 +4,8 @@ Module: tempfile
 Temporary files and directories
 */
 
+import core::option;
 import fs;
-import option;
 import option::{none, some};
 import rand;
 
diff --git a/src/libstd/term.rs b/src/libstd/term.rs
index 75c35aabd54..124e73b75d7 100644
--- a/src/libstd/term.rs
+++ b/src/libstd/term.rs
@@ -4,6 +4,8 @@ Module: term
 Simple ANSI color library
 */
 
+import core::option;
+
 // TODO: Windows support.
 
 /* Const: color_black */
diff --git a/src/libstd/test.rs b/src/libstd/test.rs
index d827d775831..abf563197a5 100644
--- a/src/libstd/test.rs
+++ b/src/libstd/test.rs
@@ -3,7 +3,12 @@
 // simplest interface possible for representing and running tests
 // while providing a base that other test frameworks may build off of.
 
+import core::comm;
+import core::task;
 import task::task;
+import core::option;
+import core::either;
+import core::vec;
 
 export test_name;
 export test_fn;
diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs
index 35d87cd518f..c7c76535846 100644
--- a/src/libstd/treemap.rs
+++ b/src/libstd/treemap.rs
@@ -9,6 +9,7 @@ red-black tree or something else.
 
 */
 
+import core::option;
 import option::{some, none};
 import option = option::t;
 
diff --git a/src/libstd/ufind.rs b/src/libstd/ufind.rs
index 7de70526a7f..4f993cbc559 100644
--- a/src/libstd/ufind.rs
+++ b/src/libstd/ufind.rs
@@ -1,4 +1,5 @@
 
+import core::option;
 import option::{some, none};
 
 
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index d8f89b3b27b..1e211d0ffcb 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -2,6 +2,7 @@
 Module: vec
 */
 
+import core::option;
 import option::{some, none};
 import uint::next_power_of_two;
 import ptr::addr_of;
diff --git a/src/libstd/win32_os.rs b/src/libstd/win32_os.rs
index 9f648ac9721..439a79ec7ac 100644
--- a/src/libstd/win32_os.rs
+++ b/src/libstd/win32_os.rs
@@ -1,3 +1,4 @@
+import core::option;
 import ctypes::*;
 
 #[abi = "cdecl"]