diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-29 17:32:50 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-30 15:52:23 -0700 |
| commit | f4fa7c8a07a96cc9d0aae0bfc6515fb747f25341 (patch) | |
| tree | 6460c18d1af201ac4e5f620be2fb1c23da5320a2 /src/libcore | |
| parent | e5e865b8044cef76bd33ba268a8cdea8a401c96c (diff) | |
| download | rust-f4fa7c8a07a96cc9d0aae0bfc6515fb747f25341.tar.gz rust-f4fa7c8a07a96cc9d0aae0bfc6515fb747f25341.zip | |
Register new snapshots
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/failure.rs | 40 |
1 files changed, 2 insertions, 38 deletions
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| -> () { @@ -71,27 +54,8 @@ fn fail_bounds_check(file: &'static str, line: uint, } #[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, |
