about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-12-20 01:12:56 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2013-12-20 01:26:03 +1100
commitc00104f36a1dd6aad318d410ffa41b9ec531880a (patch)
tree2e317d3960f021384faa3f8ae7f19a9eed1ac849 /src/libstd/rt
parentb3cee6203457b98c030a8597f97b037a8d447f40 (diff)
downloadrust-c00104f36a1dd6aad318d410ffa41b9ec531880a.tar.gz
rust-c00104f36a1dd6aad318d410ffa41b9ec531880a.zip
std: silence warnings when compiling test.
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/args.rs13
-rw-r--r--src/libstd/rt/context.rs3
-rw-r--r--src/libstd/rt/sched.rs2
-rw-r--r--src/libstd/rt/task.rs2
4 files changed, 14 insertions, 6 deletions
diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs
index 7b27161ab5d..a767af4cc0e 100644
--- a/src/libstd/rt/args.rs
+++ b/src/libstd/rt/args.rs
@@ -64,23 +64,25 @@ pub unsafe fn init(argc: int, argv: **u8) { realargs::init(argc, argv) }
 #[cfg(target_os = "freebsd")]
 mod imp {
     use cast;
-    use libc;
+    #[cfg(not(test))] use libc;
     use option::{Option, Some, None};
     use iter::Iterator;
-    use str;
+    #[cfg(not(test))] use str;
     use unstable::finally::Finally;
     use unstable::mutex::{Mutex, MUTEX_INIT};
     use util;
-    use vec;
+    #[cfg(not(test))] use vec;
 
     static mut global_args_ptr: uint = 0;
     static mut lock: Mutex = MUTEX_INIT;
 
+    #[cfg(not(test))]
     pub unsafe fn init(argc: int, argv: **u8) {
         let args = load_argc_and_argv(argc, argv);
         put(args);
     }
 
+    #[cfg(not(test))]
     pub unsafe fn cleanup() {
         rtassert!(take().is_some());
         lock.destroy();
@@ -127,6 +129,7 @@ mod imp {
     }
 
     // Copied from `os`.
+    #[cfg(not(test))]
     unsafe fn load_argc_and_argv(argc: int, argv: **u8) -> ~[~str] {
         vec::from_fn(argc as uint, |i| {
             str::raw::from_c_str(*(argv as **libc::c_char).offset(i as int))
@@ -163,8 +166,8 @@ mod imp {
     }
 }
 
-#[cfg(target_os = "macos")]
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "macos", not(test))]
+#[cfg(target_os = "win32", not(test))]
 mod imp {
     use option::Option;
 
diff --git a/src/libstd/rt/context.rs b/src/libstd/rt/context.rs
index 418557f659b..31cf0696881 100644
--- a/src/libstd/rt/context.rs
+++ b/src/libstd/rt/context.rs
@@ -395,6 +395,9 @@ pub unsafe fn record_sp_limit(limit: uint) {
 /// As with the setter, this function does not have a __morestack header and can
 /// therefore be called in a "we're out of stack" situation.
 #[inline(always)]
+// currently only called by `rust_stack_exhausted`, which doesn't
+// exist in a test build.
+#[cfg(not(test))]
 pub unsafe fn get_sp_limit() -> uint {
     return target_get_sp_limit();
 
diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs
index cd21cdeb711..15aa1602cd0 100644
--- a/src/libstd/rt/sched.rs
+++ b/src/libstd/rt/sched.rs
@@ -1341,6 +1341,8 @@ mod test {
     }
 
     // FIXME: #9407: xfail-test
+    #[ignore]
+    #[test]
     fn dont_starve_1() {
         stress_factor().times(|| {
             do run_in_mt_newsched_task {
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs
index 62e012f9f41..3299caa089a 100644
--- a/src/libstd/rt/task.rs
+++ b/src/libstd/rt/task.rs
@@ -26,7 +26,6 @@ use local_data;
 use option::{Option, Some, None};
 use rt::borrowck::BorrowRecord;
 use rt::borrowck;
-use rt::context;
 use rt::context::Context;
 use rt::env;
 use rt::kill::Death;
@@ -511,6 +510,7 @@ impl Unwinder {
                   //   irrelevant for documentation purposes.
 #[cfg(not(test))] // in testing, use the original libstd's version
 pub extern "C" fn rust_stack_exhausted() {
+    use rt::context;
     use rt::in_green_task_context;
     use rt::task::Task;
     use rt::local::Local;