From f4fa7c8a07a96cc9d0aae0bfc6515fb747f25341 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 29 May 2014 17:32:50 -0700 Subject: Register new snapshots --- src/libcore/failure.rs | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/failure.rs b/src/libcore/failure.rs index a53a380d737..d4571eb3a43 100644 --- a/src/libcore/failure.rs +++ b/src/libcore/failure.rs @@ -30,12 +30,10 @@ use fmt; use intrinsics; -#[cfg(not(test), stage0)] -use str::raw::c_str_to_static_slice; #[cold] #[inline(never)] // this is the slow path, always #[lang="fail_"] -#[cfg(not(test), not(stage0))] +#[cfg(not(test))] fn fail_(expr: &'static str, file: &'static str, line: uint) -> ! { format_args!(|args| -> () { begin_unwind(args, file, line); @@ -44,24 +42,9 @@ fn fail_(expr: &'static str, file: &'static str, line: uint) -> ! { unsafe { intrinsics::abort() } } -#[cold] #[inline(never)] // this is the slow path, always -#[lang="fail_"] -#[cfg(not(test), stage0)] -fn fail_(expr: *u8, file: *u8, line: uint) -> ! { - unsafe { - let expr = c_str_to_static_slice(expr as *i8); - let file = c_str_to_static_slice(file as *i8); - format_args!(|args| -> () { - begin_unwind(args, file, line); - }, "{}", expr); - - intrinsics::abort() - } -} - #[cold] #[lang="fail_bounds_check"] -#[cfg(not(test), not(stage0))] +#[cfg(not(test))] fn fail_bounds_check(file: &'static str, line: uint, index: uint, len: uint) -> ! { format_args!(|args| -> () { @@ -70,28 +53,9 @@ fn fail_bounds_check(file: &'static str, line: uint, unsafe { intrinsics::abort() } } -#[cold] -#[lang="fail_bounds_check"] -#[cfg(not(test), stage0)] -fn fail_bounds_check(file: *u8, line: uint, index: uint, len: uint) -> ! { - let file = unsafe { c_str_to_static_slice(file as *i8) }; - format_args!(|args| -> () { - begin_unwind(args, file, line); - }, "index out of bounds: the len is {} but the index is {}", len, index); - unsafe { intrinsics::abort() } -} - #[cold] pub fn begin_unwind(fmt: &fmt::Arguments, file: &'static str, line: uint) -> ! { #[allow(ctypes)] - #[cfg(stage0)] - extern { - #[link_name = "rust_begin_unwind"] - fn begin_unwind(fmt: &fmt::Arguments, file: &'static str, - line: uint) -> !; - } - #[allow(ctypes)] - #[cfg(not(stage0))] extern { #[lang = "begin_unwind"] fn begin_unwind(fmt: &fmt::Arguments, file: &'static str, -- cgit 1.4.1-3-g733a5