diff options
| author | bors <bors@rust-lang.org> | 2015-01-06 08:25:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-06 08:25:32 +0000 |
| commit | 340ac040f7603e169a3739c65956ed2213622be5 (patch) | |
| tree | 0502e3fcb9ceaa41d36c707e95baf0d7740fc3fd /src/libstd/rt | |
| parent | c7dd3c4d69aee1c4ad8cc220c194b176bba2ab62 (diff) | |
| parent | 4b359e3aeeaf97a190c5a7ecff8815b7b5734ece (diff) | |
| download | rust-340ac040f7603e169a3739c65956ed2213622be5.tar.gz rust-340ac040f7603e169a3739c65956ed2213622be5.zip | |
auto merge of #20610 : alexcrichton/rust/rollup, r=alexcrichton
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/args.rs | 11 | ||||
| -rw-r--r-- | src/libstd/rt/backtrace.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/macros.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/unwind.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/util.rs | 2 |
6 files changed, 9 insertions, 12 deletions
diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs index 4734a39c835..86abacb9365 100644 --- a/src/libstd/rt/args.rs +++ b/src/libstd/rt/args.rs @@ -46,8 +46,9 @@ pub fn clone() -> Option<Vec<Vec<u8>>> { imp::clone() } mod imp { use prelude::v1::*; + use libc; use mem; - use slice; + use ffi; use sync::{StaticMutex, MUTEX_INIT}; @@ -95,13 +96,9 @@ mod imp { } unsafe fn load_argc_and_argv(argc: int, argv: *const *const u8) -> Vec<Vec<u8>> { + let argv = argv as *const *const libc::c_char; range(0, argc as uint).map(|i| { - let arg = *argv.offset(i as int); - let mut len = 0u; - while *arg.offset(len as int) != 0 { - len += 1u; - } - slice::from_raw_buf(&arg, len).to_vec() + ffi::c_str_to_bytes(&*argv.offset(i as int)).to_vec() }).collect() } diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs index 578239c9cc4..bb0b6fe804b 100644 --- a/src/libstd/rt/backtrace.rs +++ b/src/libstd/rt/backtrace.rs @@ -15,7 +15,7 @@ use prelude::v1::*; use os; -use sync::atomic::{mod, Ordering}; +use sync::atomic::{self, Ordering}; pub use sys::backtrace::write; diff --git a/src/libstd/rt/macros.rs b/src/libstd/rt/macros.rs index 0f35500a04a..bbc96d0b19f 100644 --- a/src/libstd/rt/macros.rs +++ b/src/libstd/rt/macros.rs @@ -13,8 +13,6 @@ //! These macros call functions which are only accessible in the `rt` module, so //! they aren't defined anywhere outside of the `rt` module. -#![macro_escape] - macro_rules! rterrln { ($fmt:expr $($arg:tt)*) => ( { ::rt::util::dumb_print(format_args!(concat!($fmt, "\n") $($arg)*)) diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 2b0639c5705..e556888a470 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -39,6 +39,8 @@ pub use alloc::heap; pub mod backtrace; // Internals +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] mod macros; // These should be refactored/moved/made private over time diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index a48a8edd82f..71169386c18 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -67,7 +67,7 @@ use fmt; use intrinsics; use libc::c_void; use mem; -use sync::atomic::{mod, Ordering}; +use sync::atomic::{self, Ordering}; use sync::{Once, ONCE_INIT}; use rt::libunwind as uw; diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs index 883a01fa318..bc01ce926f8 100644 --- a/src/libstd/rt/util.rs +++ b/src/libstd/rt/util.rs @@ -19,7 +19,7 @@ use libc::{self, uintptr_t}; use os; use slice; use str; -use sync::atomic::{mod, Ordering}; +use sync::atomic::{self, Ordering}; /// Dynamically inquire about whether we're running under V. /// You should usually not use this unless your test definitely |
