about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-03 03:44:05 +0000
committerbors <bors@rust-lang.org>2015-02-03 03:44:05 +0000
commit7858cb432d3f2efc0374424cb2b51518f697c172 (patch)
treebccd460a861e61f758d2d459cb9da02b1ad8792b /src/libstd/rt
parenteaf4c5c784637f3df8bdebc6ec21dbd4bc69420a (diff)
parent9ece22ee00033cdf0b6b418c451112c92c8ad922 (diff)
downloadrust-7858cb432d3f2efc0374424cb2b51518f697c172.tar.gz
rust-7858cb432d3f2efc0374424cb2b51518f697c172.zip
Auto merge of #21872 - alexcrichton:rollup, r=alexcrichton
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/args.rs5
-rw-r--r--src/libstd/rt/at_exit_imp.rs2
-rw-r--r--src/libstd/rt/backtrace.rs4
-rw-r--r--src/libstd/rt/libunwind.rs2
-rw-r--r--src/libstd/rt/mod.rs4
-rw-r--r--src/libstd/rt/unwind.rs6
-rw-r--r--src/libstd/rt/util.rs9
7 files changed, 17 insertions, 15 deletions
diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs
index b63f2e2d73a..b3bed4af962 100644
--- a/src/libstd/rt/args.rs
+++ b/src/libstd/rt/args.rs
@@ -1,4 +1,4 @@
-// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
@@ -42,7 +42,8 @@ pub fn clone() -> Option<Vec<Vec<u8>>> { imp::clone() }
 #[cfg(any(target_os = "linux",
           target_os = "android",
           target_os = "freebsd",
-          target_os = "dragonfly"))]
+          target_os = "dragonfly",
+          target_os = "openbsd"))]
 mod imp {
     use prelude::v1::*;
 
diff --git a/src/libstd/rt/at_exit_imp.rs b/src/libstd/rt/at_exit_imp.rs
index 5823f8453d8..3f15cf71ec3 100644
--- a/src/libstd/rt/at_exit_imp.rs
+++ b/src/libstd/rt/at_exit_imp.rs
@@ -58,7 +58,7 @@ pub fn cleanup() {
         // If we never called init, not need to cleanup!
         if queue as uint != 0 {
             let queue: Box<Queue> = mem::transmute(queue);
-            for to_run in queue.into_iter() {
+            for to_run in *queue {
                 to_run.invoke(());
             }
         }
diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs
index f2d66e1a4d7..905cc06c4f0 100644
--- a/src/libstd/rt/backtrace.rs
+++ b/src/libstd/rt/backtrace.rs
@@ -14,7 +14,7 @@
 
 use prelude::v1::*;
 
-use os;
+use env;
 use sync::atomic::{self, Ordering};
 
 pub use sys::backtrace::write;
@@ -29,7 +29,7 @@ pub fn log_enabled() -> bool {
         _ => {}
     }
 
-    let val = match os::getenv("RUST_BACKTRACE") {
+    let val = match env::var("RUST_BACKTRACE") {
         Some(..) => 2,
         None => 1,
     };
diff --git a/src/libstd/rt/libunwind.rs b/src/libstd/rt/libunwind.rs
index dd9923307d6..43e3a43f56d 100644
--- a/src/libstd/rt/libunwind.rs
+++ b/src/libstd/rt/libunwind.rs
@@ -101,7 +101,7 @@ pub type _Unwind_Exception_Cleanup_Fn =
 #[link(name = "gcc_s")]
 extern {}
 
-#[cfg(target_os = "android")]
+#[cfg(any(target_os = "android", target_os = "openbsd"))]
 #[link(name = "gcc")]
 extern {}
 
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs
index 7e19f1cac2c..00088d6d99a 100644
--- a/src/libstd/rt/mod.rs
+++ b/src/libstd/rt/mod.rs
@@ -65,7 +65,7 @@ fn lang_start(main: *const u8, argc: int, argv: *const *const u8) -> int {
     use prelude::v1::*;
 
     use mem;
-    use os;
+    use env;
     use rt;
     use sys_common::thread_info::{self, NewThread};
     use sys_common;
@@ -131,7 +131,7 @@ fn lang_start(main: *const u8, argc: int, argv: *const *const u8) -> int {
     if failed {
         rt::DEFAULT_ERROR_CODE
     } else {
-        os::get_exit_status()
+        env::get_exit_status() as isize
     }
 }
 
diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs
index fb40a6c8f60..81ca5aa0e8a 100644
--- a/src/libstd/rt/unwind.rs
+++ b/src/libstd/rt/unwind.rs
@@ -160,7 +160,7 @@ pub fn panicking() -> bool {
 // An uninlined, unmangled function upon which to slap yer breakpoints
 #[inline(never)]
 #[no_mangle]
-#[cfg_attr(not(stage0), allow(private_no_mangle_fns))]
+#[allow(private_no_mangle_fns)]
 fn rust_panic(cause: Box<Any + Send>) -> ! {
     rtdebug!("begin_unwind()");
 
@@ -238,7 +238,7 @@ pub mod eabi {
 
     #[lang="eh_personality"]
     #[no_mangle] // referenced from rust_try.ll
-    #[cfg_attr(not(stage0), allow(private_no_mangle_fns))]
+    #[allow(private_no_mangle_fns)]
     extern fn rust_eh_personality(
         version: c_int,
         actions: uw::_Unwind_Action,
@@ -551,7 +551,7 @@ fn begin_unwind_inner(msg: Box<Any + Send>, file_line: &(&'static str, uint)) ->
         let amt = CALLBACK_CNT.load(Ordering::SeqCst);
         &CALLBACKS[..cmp::min(amt, MAX_CALLBACKS)]
     };
-    for cb in callbacks.iter() {
+    for cb in callbacks {
         match cb.load(Ordering::SeqCst) {
             0 => {}
             n => {
diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs
index f5727a38b69..86d21cf7278 100644
--- a/src/libstd/rt/util.rs
+++ b/src/libstd/rt/util.rs
@@ -13,6 +13,7 @@
 use prelude::v1::*;
 
 use cmp;
+use env;
 use fmt;
 use intrinsics;
 use libc::{self, uintptr_t};
@@ -51,7 +52,7 @@ pub fn min_stack() -> uint {
         0 => {}
         n => return n - 1,
     }
-    let amt = os::getenv("RUST_MIN_STACK").and_then(|s| s.parse().ok());
+    let amt = env::var_string("RUST_MIN_STACK").ok().and_then(|s| s.parse().ok());
     let amt = amt.unwrap_or(2 * 1024 * 1024);
     // 0 is our sentinel value, so ensure that we'll never see 0 after
     // initialization has run
@@ -62,15 +63,15 @@ pub fn min_stack() -> uint {
 /// Get's the number of scheduler threads requested by the environment
 /// either `RUST_THREADS` or `num_cpus`.
 pub fn default_sched_threads() -> uint {
-    match os::getenv("RUST_THREADS") {
-        Some(nstr) => {
+    match env::var_string("RUST_THREADS") {
+        Ok(nstr) => {
             let opt_n: Option<uint> = nstr.parse().ok();
             match opt_n {
                 Some(n) if n > 0 => n,
                 _ => panic!("`RUST_THREADS` is `{}`, should be a positive integer", nstr)
             }
         }
-        None => {
+        Err(..) => {
             if limit_thread_creation_due_to_osx_and_valgrind() {
                 1
             } else {