diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-09-08 15:53:46 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-09-11 11:19:20 -0700 |
| commit | f4be2026dfb507e5db919cc5df8fd934e05fa0b8 (patch) | |
| tree | 278d5b3916042e7232b7ba98a5ead399a52057eb /src/liblog/lib.rs | |
| parent | 192c37537bc6ffaee06e8b4099dd09ae43bcfee7 (diff) | |
| download | rust-f4be2026dfb507e5db919cc5df8fd934e05fa0b8.tar.gz rust-f4be2026dfb507e5db919cc5df8fd934e05fa0b8.zip | |
std: Internalize almost all of `std::rt`
This commit does some refactoring to make almost all of the `std::rt` private. Specifically, the following items are no longer part of its API: * DEFAULT_ERROR_CODE * backtrace * unwind * args * at_exit * cleanup * heap (this is just alloc::heap) * min_stack * util The module is now tagged as `#[doc(hidden)]` as the only purpose it's serve is an entry point for the `panic!` macro via the `begin_unwind` and `begin_unwind_fmt` reexports.
Diffstat (limited to 'src/liblog/lib.rs')
| -rw-r--r-- | src/liblog/lib.rs | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index 4517c2f9157..d59e40fb149 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -174,7 +174,6 @@ #![feature(box_syntax)] #![feature(const_fn)] #![feature(iter_cmp)] -#![feature(rt)] #![feature(staged_api)] #![feature(static_mutex)] @@ -185,7 +184,6 @@ use std::io::prelude::*; use std::mem; use std::env; use std::ptr; -use std::rt; use std::slice; use std::sync::{Once, StaticMutex}; @@ -292,7 +290,6 @@ pub fn log(level: u32, loc: &'static LogLocation, args: fmt::Arguments) { let _g = LOCK.lock(); match FILTER as usize { 0 => {} - 1 => panic!("cannot log after main thread has exited"), n => { let filter = mem::transmute::<_, &String>(n); if !args.to_string().contains(filter) { @@ -385,9 +382,6 @@ pub fn mod_enabled(level: u32, module: &str) -> bool { let _g = LOCK.lock(); unsafe { assert!(DIRECTIVES as usize != 0); - assert!(DIRECTIVES as usize != 1, - "cannot log after the main thread has exited"); - enabled(level, module, (*DIRECTIVES).iter()) } } @@ -442,19 +436,6 @@ fn init() { assert!(DIRECTIVES.is_null()); DIRECTIVES = Box::into_raw(box directives); - - // Schedule the cleanup for the globals for when the runtime exits. - let _ = rt::at_exit(move || { - let _g = LOCK.lock(); - assert!(!DIRECTIVES.is_null()); - let _directives = Box::from_raw(DIRECTIVES); - DIRECTIVES = 1 as *mut _; - - if !FILTER.is_null() { - let _filter = Box::from_raw(FILTER); - FILTER = 1 as *mut _; - } - }); } } |
