Skip to content

Commit 021e81f

Browse files
committed
std::rt: move abort function to util module
1 parent 9ef4c41 commit 021e81f

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/libstd/macros.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,10 @@ macro_rules! rtassert (
3939
)
4040

4141

42-
// The do_abort function was originally inside the abort macro, but
43-
// this was ICEing the compiler so it has been moved outside. Now this
44-
// seems to work?
45-
#[allow(missing_doc)]
46-
pub fn do_abort() -> ! {
47-
unsafe { ::libc::abort(); }
48-
}
49-
5042
macro_rules! abort(
5143
($( $msg:expr),+) => ( {
5244
rtdebug!($($msg),+);
53-
::macros::do_abort();
45+
::rt::util::abort();
5446
} )
5547
)
5648

src/libstd/rt/util.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ pub fn num_cpus() -> uint {
1919
extern {
2020
fn rust_get_num_cpus() -> libc::uintptr_t;
2121
}
22+
}
23+
24+
pub fn abort() -> ! {
25+
unsafe { libc::abort(); }
2226
}

0 commit comments

Comments
 (0)