diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-09-23 18:13:21 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-09-23 20:29:01 -0700 |
| commit | 51cfcc83824b0c2e5569e40f5266c0493603d691 (patch) | |
| tree | 0b5aa91def4c1b4ac197dce371a065b3679091ae /src/libstd/rt | |
| parent | 97053995046636c0e11d23c4f0523d278a4210c9 (diff) | |
| download | rust-51cfcc83824b0c2e5569e40f5266c0493603d691.tar.gz rust-51cfcc83824b0c2e5569e40f5266c0493603d691.zip | |
Register new snapshots
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/crate_map.rs | 6 | ||||
| -rw-r--r-- | src/libstd/rt/logging.rs | 18 | ||||
| -rw-r--r-- | src/libstd/rt/mod.rs | 30 |
3 files changed, 4 insertions, 50 deletions
diff --git a/src/libstd/rt/crate_map.rs b/src/libstd/rt/crate_map.rs index f73aa1fad67..67cbdaae4fa 100644 --- a/src/libstd/rt/crate_map.rs +++ b/src/libstd/rt/crate_map.rs @@ -23,7 +23,7 @@ use container::MutableSet; #[link_args = "-undefined dynamic_lookup"] extern {} -#[cfg(not(stage0), not(windows))] +#[cfg(not(windows))] extern { #[weak_linkage] #[link_name = "_rust_crate_map_toplevel"] @@ -48,12 +48,12 @@ struct CrateMap { children: [*CrateMap, ..1] } -#[cfg(not(stage0), not(windows))] +#[cfg(not(windows))] pub fn get_crate_map() -> *CrateMap { &'static CRATE_MAP as *CrateMap } -#[cfg(not(stage0), windows)] +#[cfg(windows)] #[fixed_stack_segment] #[inline(never)] pub fn get_crate_map() -> *CrateMap { diff --git a/src/libstd/rt/logging.rs b/src/libstd/rt/logging.rs index 26072079bcc..3dbf7a918b7 100644 --- a/src/libstd/rt/logging.rs +++ b/src/libstd/rt/logging.rs @@ -12,7 +12,7 @@ use libc::{uintptr_t, exit, STDERR_FILENO}; use option::{Some, None, Option}; use rt::util::dumb_println; use rt::crate_map::{ModEntry, iter_crate_map}; -#[cfg(not(stage0))] use rt::crate_map::get_crate_map; +use rt::crate_map::get_crate_map; use str::StrSlice; use str::raw::from_c_str; use u32; @@ -211,22 +211,6 @@ impl Logger for StdErrLogger { } /// Configure logging by traversing the crate map and setting the /// per-module global logging flags based on the logging spec -#[fixed_stack_segment] #[inline(never)] -#[cfg(stage0)] -pub fn init(crate_map: *u8) { - use os; - - let log_spec = os::getenv("RUST_LOG"); - match log_spec { - Some(spec) => { - update_log_settings(crate_map, spec); - } - None => { - update_log_settings(crate_map, ~""); - } - } -} -#[cfg(not(stage0))] pub fn init() { use os; diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 85a379cab5a..2ece2800cf2 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -176,16 +176,6 @@ pub mod borrowck; /// # Return value /// /// The return value is used as the process return code. 0 on success, 101 on error. -#[cfg(stage0)] -pub fn start(argc: int, argv: **u8, crate_map: *u8, main: ~fn()) -> int { - - init(argc, argv, crate_map); - let exit_code = run(main); - cleanup(); - - return exit_code; -} -#[cfg(not(stage0))] pub fn start(argc: int, argv: **u8, main: ~fn()) -> int { init(argc, argv); @@ -200,15 +190,6 @@ pub fn start(argc: int, argv: **u8, main: ~fn()) -> int { /// /// This is appropriate for running code that must execute on the main thread, /// such as the platform event loop and GUI. -#[cfg(stage0)] -pub fn start_on_main_thread(argc: int, argv: **u8, crate_map: *u8, main: ~fn()) -> int { - init(argc, argv, crate_map); - let exit_code = run_on_main_thread(main); - cleanup(); - - return exit_code; -} -#[cfg(not(stage0))] pub fn start_on_main_thread(argc: int, argv: **u8, main: ~fn()) -> int { init(argc, argv); let exit_code = run_on_main_thread(main); @@ -222,17 +203,6 @@ pub fn start_on_main_thread(argc: int, argv: **u8, main: ~fn()) -> int { /// Initializes global state, including frobbing /// the crate's logging flags, registering GC /// metadata, and storing the process arguments. -#[cfg(stage0)] -pub fn init(argc: int, argv: **u8, crate_map: *u8) { - // XXX: Derefing these pointers is not safe. - // Need to propagate the unsafety to `start`. - unsafe { - args::init(argc, argv); - env::init(); - logging::init(crate_map); - } -} -#[cfg(not(stage0))] pub fn init(argc: int, argv: **u8) { // XXX: Derefing these pointers is not safe. // Need to propagate the unsafety to `start`. |
