mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
std: Rename abort! to rtabort! to match other macros
This commit is contained in:
@@ -33,13 +33,13 @@ macro_rules! rtdebug (
|
||||
macro_rules! rtassert (
|
||||
( $arg:expr ) => ( {
|
||||
if !$arg {
|
||||
abort!("assertion failed: %s", stringify!($arg));
|
||||
rtabort!("assertion failed: %s", stringify!($arg));
|
||||
}
|
||||
} )
|
||||
)
|
||||
|
||||
|
||||
macro_rules! abort(
|
||||
macro_rules! rtabort(
|
||||
($( $msg:expr),+) => ( {
|
||||
rtdebug!($($msg),+);
|
||||
::rt::util::abort();
|
||||
|
||||
@@ -82,7 +82,7 @@ pub fn cleanup() {
|
||||
let count_ptr = exchange_count_ptr();
|
||||
let allocations = atomic_load(&*count_ptr);
|
||||
if allocations != 0 {
|
||||
abort!("exchange heap not empty on exit\
|
||||
rtabort!("exchange heap not empty on exit\
|
||||
%i dangling allocations", allocations);
|
||||
}
|
||||
}
|
||||
|
||||
+12
-12
@@ -38,17 +38,17 @@ fn borrow<T>(f: &fn(&mut Scheduler) -> T) -> T {
|
||||
}
|
||||
match res {
|
||||
Some(r) => { r }
|
||||
None => abort!("function failed!")
|
||||
None => rtabort!("function failed!")
|
||||
}
|
||||
}
|
||||
unsafe fn unsafe_borrow() -> *mut Scheduler { local_ptr::unsafe_borrow() }
|
||||
unsafe fn try_unsafe_borrow() -> Option<*mut Scheduler> { abort!("unimpl") }
|
||||
unsafe fn try_unsafe_borrow() -> Option<*mut Scheduler> { rtabort!("unimpl") }
|
||||
}
|
||||
|
||||
impl Local for Task {
|
||||
fn put(_value: ~Task) { abort!("unimpl") }
|
||||
fn take() -> ~Task { abort!("unimpl") }
|
||||
fn exists() -> bool { abort!("unimpl") }
|
||||
fn put(_value: ~Task) { rtabort!("unimpl") }
|
||||
fn take() -> ~Task { rtabort!("unimpl") }
|
||||
fn exists() -> bool { rtabort!("unimpl") }
|
||||
fn borrow<T>(f: &fn(&mut Task) -> T) -> T {
|
||||
do Local::borrow::<Scheduler, T> |sched| {
|
||||
match sched.current_task {
|
||||
@@ -56,7 +56,7 @@ fn borrow<T>(f: &fn(&mut Task) -> T) -> T {
|
||||
f(&mut *task.task)
|
||||
}
|
||||
None => {
|
||||
abort!("no scheduler")
|
||||
rtabort!("no scheduler")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ unsafe fn unsafe_borrow() -> *mut Task {
|
||||
}
|
||||
None => {
|
||||
// Don't fail. Infinite recursion
|
||||
abort!("no scheduler")
|
||||
rtabort!("no scheduler")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,16 +84,16 @@ unsafe fn try_unsafe_borrow() -> Option<*mut Task> {
|
||||
|
||||
// XXX: This formulation won't work once ~IoFactoryObject is a real trait pointer
|
||||
impl Local for IoFactoryObject {
|
||||
fn put(_value: ~IoFactoryObject) { abort!("unimpl") }
|
||||
fn take() -> ~IoFactoryObject { abort!("unimpl") }
|
||||
fn exists() -> bool { abort!("unimpl") }
|
||||
fn borrow<T>(_f: &fn(&mut IoFactoryObject) -> T) -> T { abort!("unimpl") }
|
||||
fn put(_value: ~IoFactoryObject) { rtabort!("unimpl") }
|
||||
fn take() -> ~IoFactoryObject { rtabort!("unimpl") }
|
||||
fn exists() -> bool { rtabort!("unimpl") }
|
||||
fn borrow<T>(_f: &fn(&mut IoFactoryObject) -> T) -> T { rtabort!("unimpl") }
|
||||
unsafe fn unsafe_borrow() -> *mut IoFactoryObject {
|
||||
let sched = Local::unsafe_borrow::<Scheduler>();
|
||||
let io: *mut IoFactoryObject = (*sched).event_loop.io().unwrap();
|
||||
return io;
|
||||
}
|
||||
unsafe fn try_unsafe_borrow() -> Option<*mut IoFactoryObject> { abort!("unimpl") }
|
||||
unsafe fn try_unsafe_borrow() -> Option<*mut IoFactoryObject> { rtabort!("unimpl") }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -109,7 +109,7 @@ pub unsafe fn unsafe_borrow<T>() -> *mut T {
|
||||
fn tls_key() -> tls::Key {
|
||||
match maybe_tls_key() {
|
||||
Some(key) => key,
|
||||
None => abort!("runtime tls key not initialized")
|
||||
None => rtabort!("runtime tls key not initialized")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -357,7 +357,7 @@ fn send_task_home(task: ~Coroutine) {
|
||||
home_handle.send(PinnedTask(task));
|
||||
}
|
||||
AnySched => {
|
||||
abort!("error: cannot send anysched task home");
|
||||
rtabort!("error: cannot send anysched task home");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,10 +422,10 @@ fn resume_task_from_queue(~self) -> bool {
|
||||
return true;
|
||||
}
|
||||
4 => {
|
||||
abort!("task home was None!");
|
||||
rtabort!("task home was None!");
|
||||
}
|
||||
_ => {
|
||||
abort!("literally, you should not be here");
|
||||
rtabort!("literally, you should not be here");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -452,7 +452,7 @@ pub fn terminate_current_task(~self) {
|
||||
dead_task.take().recycle(&mut sched.stack_pool);
|
||||
}
|
||||
|
||||
abort!("control reached end of task");
|
||||
rtabort!("control reached end of task");
|
||||
}
|
||||
|
||||
pub fn schedule_task(~self, task: ~Coroutine) {
|
||||
@@ -672,7 +672,7 @@ pub fn is_home(&self) -> bool {
|
||||
Some(Sched(SchedHandle { sched_id: ref id, _ })) => {
|
||||
*id == sched.sched_id()
|
||||
}
|
||||
None => { abort!("error: homeless task!"); }
|
||||
None => { rtabort!("error: homeless task!"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -696,7 +696,7 @@ fn homed(&self) -> bool {
|
||||
match self.task.home {
|
||||
Some(AnySched) => { false }
|
||||
Some(Sched(_)) => { true }
|
||||
None => { abort!("error: homeless task!");
|
||||
None => { rtabort!("error: homeless task!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -710,7 +710,7 @@ fn is_home_no_tls(&self, sched: &~Scheduler) -> bool {
|
||||
Some(Sched(SchedHandle { sched_id: ref id, _})) => {
|
||||
*id == sched.sched_id()
|
||||
}
|
||||
None => { abort!("error: homeless task!"); }
|
||||
None => { rtabort!("error: homeless task!"); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user