Skip to content

Commit 3ce2e0d

Browse files
committed
Rollup merge of #22347 - iKevinY:std-lib-panicking, r=brson
Rename `libstd/failure.rs` to `libstd/panicking.rs` and `on_fail` to `on_panic`. Closes #22306.
2 parents f43546f + 1e01f7f commit 3ce2e0d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/libstd/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ pub mod sync;
279279
#[path = "sys/common/mod.rs"] mod sys_common;
280280

281281
pub mod rt;
282-
mod failure;
282+
mod panicking;
283283

284284
// Documentation for primitive types
285285

src/libstd/old_io/stdio.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use self::StdSource::*;
3030
use boxed::Box;
3131
use cell::RefCell;
3232
use clone::Clone;
33-
use failure::LOCAL_STDERR;
33+
use panicking::LOCAL_STDERR;
3434
use fmt;
3535
use old_io::{Reader, Writer, IoResult, IoError, OtherIoError, Buffer,
3636
standard_error, EndOfFile, LineBufferedWriter, BufferedReader};

src/libstd/failure.rs renamed to src/libstd/panicking.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Writer for Stdio {
3333
}
3434
}
3535

36-
pub fn on_fail(obj: &(Any+Send), file: &'static str, line: uint) {
36+
pub fn on_panic(obj: &(Any+Send), file: &'static str, line: uint) {
3737
let msg = match obj.downcast_ref::<&'static str>() {
3838
Some(s) => *s,
3939
None => match obj.downcast_ref::<String>() {

src/libstd/rt/unwind.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ use prelude::v1::*;
6262
use any::Any;
6363
use cell::Cell;
6464
use cmp;
65-
use failure;
65+
use panicking;
6666
use fmt;
6767
use intrinsics;
6868
use libc::c_void;
@@ -534,10 +534,10 @@ pub fn begin_unwind<M: Any + Send>(msg: M, file_line: &(&'static str, uint)) ->
534534
/// }` from ~1900/3700 (-O/no opts) to 180/590.
535535
#[inline(never)] #[cold] // this is the slow path, please never inline this
536536
fn begin_unwind_inner(msg: Box<Any + Send>, file_line: &(&'static str, uint)) -> ! {
537-
// Make sure the default failure handler is registered before we look at the
537+
// Make sure the default panic handler is registered before we look at the
538538
// callbacks.
539539
static INIT: Once = ONCE_INIT;
540-
INIT.call_once(|| unsafe { register(failure::on_fail); });
540+
INIT.call_once(|| unsafe { register(panicking::on_panic); });
541541

542542
// First, invoke call the user-defined callbacks triggered on thread panic.
543543
//

0 commit comments

Comments
 (0)