Replace most invocations of fail keyword with die! macro
This commit is contained in:
parent
2db3175c76
commit
aee7929469
331 changed files with 914 additions and 908 deletions
|
@ -221,7 +221,7 @@ pub fn unwrap_mutex_arc<T: Owned>(arc: MutexARC<T>) -> T {
|
|||
let inner = unsafe { unwrap_shared_mutable_state(move x) };
|
||||
let MutexARCInner { failed: failed, data: data, _ } = move inner;
|
||||
if failed {
|
||||
fail ~"Can't unwrap poisoned MutexARC - another task failed inside!"
|
||||
die!(~"Can't unwrap poisoned MutexARC - another task failed inside!")
|
||||
}
|
||||
move data
|
||||
}
|
||||
|
@ -232,9 +232,9 @@ pub fn unwrap_mutex_arc<T: Owned>(arc: MutexARC<T>) -> T {
|
|||
fn check_poison(is_mutex: bool, failed: bool) {
|
||||
if failed {
|
||||
if is_mutex {
|
||||
fail ~"Poisoned MutexARC - another task failed inside!";
|
||||
die!(~"Poisoned MutexARC - another task failed inside!");
|
||||
} else {
|
||||
fail ~"Poisoned rw_arc - another task failed inside!";
|
||||
die!(~"Poisoned rw_arc - another task failed inside!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -410,7 +410,7 @@ pub fn unwrap_rw_arc<T: Const Owned>(arc: RWARC<T>) -> T {
|
|||
let inner = unsafe { unwrap_shared_mutable_state(move x) };
|
||||
let RWARCInner { failed: failed, data: data, _ } = move inner;
|
||||
if failed {
|
||||
fail ~"Can't unwrap poisoned RWARC - another task failed inside!"
|
||||
die!(~"Can't unwrap poisoned RWARC - another task failed inside!")
|
||||
}
|
||||
move data
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue