Skip to content

Commit

Permalink
Rename begin_unwind_string to fail_str, refs #16114
Browse files Browse the repository at this point in the history
  • Loading branch information
fhahn committed Sep 24, 2014
1 parent 1c7d253 commit c8b767d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/libcore/failure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn fail_(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
let (expr, file, line) = *expr_file_line;
let ref file_line = (file, line);
format_args!(|args| -> () {
fail_impl(args, file_line);
fail_fmt(args, file_line);
}, "{}", expr);

unsafe { intrinsics::abort() }
Expand All @@ -54,7 +54,7 @@ fn fail(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
let (expr, file, line) = *expr_file_line;
let ref file_line = (file, line);
format_args!(|args| -> () {
fail_impl(args, file_line);
fail_fmt(args, file_line);
}, "{}", expr);

unsafe { intrinsics::abort() }
Expand All @@ -65,18 +65,18 @@ fn fail(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
fn fail_bounds_check(file_line: &(&'static str, uint),
index: uint, len: uint) -> ! {
format_args!(|args| -> () {
fail_impl(args, file_line);
fail_fmt(args, file_line);
}, "index out of bounds: the len is {} but the index is {}", len, index);
unsafe { intrinsics::abort() }
}

#[cold] #[inline(never)]
pub fn fail_impl_string(msg: &str, file: &(&'static str, uint)) -> ! {
format_args!(|fmt| fail_impl(fmt, file), "{}", msg)
pub fn fail_str(msg: &str, file: &(&'static str, uint)) -> ! {
format_args!(|fmt| fail_fmt(fmt, file), "{}", msg)
}

#[cold] #[inline(never)]
pub fn fail_impl(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
pub fn fail_fmt(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
#[allow(ctypes)]
extern {

Expand Down
4 changes: 2 additions & 2 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ macro_rules! fail(
);
($msg:expr) => ({
static _FILE_LINE: (&'static str, uint) = (file!(), line!());
::core::failure::fail_impl_string($msg, &_FILE_LINE)
::core::failure::fail_str($msg, &_FILE_LINE)
});
($fmt:expr, $($arg:tt)*) => ({
// a closure can't have return type !, so we need a full
Expand All @@ -40,7 +40,7 @@ macro_rules! fail(
#[inline(always)]
fn _run_fmt(fmt: &::std::fmt::Arguments) -> ! {
static _FILE_LINE: (&'static str, uint) = (file!(), line!());
::core::failure::fail_impl(fmt, &_FILE_LINE)
::core::failure::fail_fmt(fmt, &_FILE_LINE)
}
format_args!(_run_fmt, $fmt, $($arg)*)
});
Expand Down

5 comments on commit c8b767d

@bors
Copy link
Contributor

@bors bors commented on c8b767d Sep 25, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at fhahn@c8b767d

@bors
Copy link
Contributor

@bors bors commented on c8b767d Sep 25, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging fhahn/rust/issue-16114-rename-begin-unwind-2 = c8b767d into auto

@bors
Copy link
Contributor

@bors bors commented on c8b767d Sep 25, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fhahn/rust/issue-16114-rename-begin-unwind-2 = c8b767d merged ok, testing candidate = 9ff3081

@bors
Copy link
Contributor

@bors bors commented on c8b767d Sep 25, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on c8b767d Sep 25, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 9ff3081

Please sign in to comment.