std::rt: move abort function to util module

This commit is contained in:
Brian Anderson 2013-06-17 23:22:41 -07:00
parent 9ef4c413a8
commit 021e81fbd3
2 changed files with 5 additions and 9 deletions

View file

@ -39,18 +39,10 @@ macro_rules! rtassert (
)
// The do_abort function was originally inside the abort macro, but
// this was ICEing the compiler so it has been moved outside. Now this
// seems to work?
#[allow(missing_doc)]
pub fn do_abort() -> ! {
unsafe { ::libc::abort(); }
}
macro_rules! abort(
($( $msg:expr),+) => ( {
rtdebug!($($msg),+);
::macros::do_abort();
::rt::util::abort();
} )
)

View file

@ -19,4 +19,8 @@ pub fn num_cpus() -> uint {
extern {
fn rust_get_num_cpus() -> libc::uintptr_t;
}
}
pub fn abort() -> ! {
unsafe { libc::abort(); }
}