Skip to content

Commit b5fbec9

Browse files
committed
std: Rename abort! to rtabort! to match other macros
1 parent 021e81f commit b5fbec9

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

src/libstd/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ macro_rules! rtdebug (
3333
macro_rules! rtassert (
3434
( $arg:expr ) => ( {
3535
if !$arg {
36-
abort!("assertion failed: %s", stringify!($arg));
36+
rtabort!("assertion failed: %s", stringify!($arg));
3737
}
3838
} )
3939
)
4040

4141

42-
macro_rules! abort(
42+
macro_rules! rtabort(
4343
($( $msg:expr),+) => ( {
4444
rtdebug!($($msg),+);
4545
::rt::util::abort();

src/libstd/rt/global_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub fn cleanup() {
8282
let count_ptr = exchange_count_ptr();
8383
let allocations = atomic_load(&*count_ptr);
8484
if allocations != 0 {
85-
abort!("exchange heap not empty on exit\
85+
rtabort!("exchange heap not empty on exit\
8686
%i dangling allocations", allocations);
8787
}
8888
}

src/libstd/rt/local.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,25 @@ impl Local for Scheduler {
3838
}
3939
match res {
4040
Some(r) => { r }
41-
None => abort!("function failed!")
41+
None => rtabort!("function failed!")
4242
}
4343
}
4444
unsafe fn unsafe_borrow() -> *mut Scheduler { local_ptr::unsafe_borrow() }
45-
unsafe fn try_unsafe_borrow() -> Option<*mut Scheduler> { abort!("unimpl") }
45+
unsafe fn try_unsafe_borrow() -> Option<*mut Scheduler> { rtabort!("unimpl") }
4646
}
4747

4848
impl Local for Task {
49-
fn put(_value: ~Task) { abort!("unimpl") }
50-
fn take() -> ~Task { abort!("unimpl") }
51-
fn exists() -> bool { abort!("unimpl") }
49+
fn put(_value: ~Task) { rtabort!("unimpl") }
50+
fn take() -> ~Task { rtabort!("unimpl") }
51+
fn exists() -> bool { rtabort!("unimpl") }
5252
fn borrow<T>(f: &fn(&mut Task) -> T) -> T {
5353
do Local::borrow::<Scheduler, T> |sched| {
5454
match sched.current_task {
5555
Some(~ref mut task) => {
5656
f(&mut *task.task)
5757
}
5858
None => {
59-
abort!("no scheduler")
59+
rtabort!("no scheduler")
6060
}
6161
}
6262
}
@@ -69,7 +69,7 @@ impl Local for Task {
6969
}
7070
None => {
7171
// Don't fail. Infinite recursion
72-
abort!("no scheduler")
72+
rtabort!("no scheduler")
7373
}
7474
}
7575
}
@@ -84,16 +84,16 @@ impl Local for Task {
8484

8585
// XXX: This formulation won't work once ~IoFactoryObject is a real trait pointer
8686
impl Local for IoFactoryObject {
87-
fn put(_value: ~IoFactoryObject) { abort!("unimpl") }
88-
fn take() -> ~IoFactoryObject { abort!("unimpl") }
89-
fn exists() -> bool { abort!("unimpl") }
90-
fn borrow<T>(_f: &fn(&mut IoFactoryObject) -> T) -> T { abort!("unimpl") }
87+
fn put(_value: ~IoFactoryObject) { rtabort!("unimpl") }
88+
fn take() -> ~IoFactoryObject { rtabort!("unimpl") }
89+
fn exists() -> bool { rtabort!("unimpl") }
90+
fn borrow<T>(_f: &fn(&mut IoFactoryObject) -> T) -> T { rtabort!("unimpl") }
9191
unsafe fn unsafe_borrow() -> *mut IoFactoryObject {
9292
let sched = Local::unsafe_borrow::<Scheduler>();
9393
let io: *mut IoFactoryObject = (*sched).event_loop.io().unwrap();
9494
return io;
9595
}
96-
unsafe fn try_unsafe_borrow() -> Option<*mut IoFactoryObject> { abort!("unimpl") }
96+
unsafe fn try_unsafe_borrow() -> Option<*mut IoFactoryObject> { rtabort!("unimpl") }
9797
}
9898

9999
#[cfg(test)]

src/libstd/rt/local_ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub unsafe fn unsafe_borrow<T>() -> *mut T {
109109
fn tls_key() -> tls::Key {
110110
match maybe_tls_key() {
111111
Some(key) => key,
112-
None => abort!("runtime tls key not initialized")
112+
None => rtabort!("runtime tls key not initialized")
113113
}
114114
}
115115

src/libstd/rt/sched.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ impl Scheduler {
357357
home_handle.send(PinnedTask(task));
358358
}
359359
AnySched => {
360-
abort!("error: cannot send anysched task home");
360+
rtabort!("error: cannot send anysched task home");
361361
}
362362
}
363363
}
@@ -422,10 +422,10 @@ impl Scheduler {
422422
return true;
423423
}
424424
4 => {
425-
abort!("task home was None!");
425+
rtabort!("task home was None!");
426426
}
427427
_ => {
428-
abort!("literally, you should not be here");
428+
rtabort!("literally, you should not be here");
429429
}
430430
}
431431
}
@@ -452,7 +452,7 @@ impl Scheduler {
452452
dead_task.take().recycle(&mut sched.stack_pool);
453453
}
454454

455-
abort!("control reached end of task");
455+
rtabort!("control reached end of task");
456456
}
457457

458458
pub fn schedule_task(~self, task: ~Coroutine) {
@@ -672,7 +672,7 @@ impl Coroutine {
672672
Some(Sched(SchedHandle { sched_id: ref id, _ })) => {
673673
*id == sched.sched_id()
674674
}
675-
None => { abort!("error: homeless task!"); }
675+
None => { rtabort!("error: homeless task!"); }
676676
}
677677
}
678678
}
@@ -696,7 +696,7 @@ impl Coroutine {
696696
match self.task.home {
697697
Some(AnySched) => { false }
698698
Some(Sched(_)) => { true }
699-
None => { abort!("error: homeless task!");
699+
None => { rtabort!("error: homeless task!");
700700
}
701701
}
702702
}
@@ -710,7 +710,7 @@ impl Coroutine {
710710
Some(Sched(SchedHandle { sched_id: ref id, _})) => {
711711
*id == sched.sched_id()
712712
}
713-
None => { abort!("error: homeless task!"); }
713+
None => { rtabort!("error: homeless task!"); }
714714
}
715715
}
716716

0 commit comments

Comments
 (0)