]> git.lizzy.rs Git - rust.git/commitdiff
core: Remove unneeded cfgs
authorBrian Anderson <banderson@mozilla.com>
Fri, 25 Jul 2014 22:54:10 +0000 (15:54 -0700)
committerBrian Anderson <banderson@mozilla.com>
Fri, 25 Jul 2014 22:54:10 +0000 (15:54 -0700)
src/libcore/failure.rs

index 022258911f1e09b419c86d2437df7d7aeb66ea2e..5965603770ba7ca671152abb34b476666a5a160b 100644 (file)
@@ -33,7 +33,6 @@
 use fmt;
 use intrinsics;
 
-#[cfg(stage0)]
 #[cold] #[inline(never)] // this is the slow path, always
 #[lang="fail_"]
 fn fail_(expr: &'static str, file: &'static str, line: uint) -> ! {
@@ -44,7 +43,6 @@ fn fail_(expr: &'static str, file: &'static str, line: uint) -> ! {
     unsafe { intrinsics::abort() }
 }
 
-#[cfg(stage0)]
 #[cold]
 #[lang="fail_bounds_check"]
 fn fail_bounds_check(file: &'static str, line: uint,
@@ -55,7 +53,6 @@ fn fail_bounds_check(file: &'static str, line: uint,
     unsafe { intrinsics::abort() }
 }
 
-#[cfg(stage0)]
 #[cold]
 pub fn begin_unwind(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
     #[allow(ctypes)]
@@ -68,37 +65,3 @@ fn begin_unwind(fmt: &fmt::Arguments, file: &'static str,
     unsafe { begin_unwind(fmt, file, line) }
 }
 
-#[cfg(not(stage0))]
-#[cold] #[inline(never)] // this is the slow path, always
-#[lang="fail_"]
-fn fail_(expr: &'static str, file: &'static str, line: uint) -> ! {
-    format_args!(|args| -> () {
-        begin_unwind(args, &(file, line));
-    }, "{}", expr);
-
-    unsafe { intrinsics::abort() }
-}
-
-#[cfg(not(stage0))]
-#[cold]
-#[lang="fail_bounds_check"]
-fn fail_bounds_check(file: &'static str, line: uint,
-                     index: uint, len: uint) -> ! {
-    format_args!(|args| -> () {
-        begin_unwind(args, &(file, line));
-    }, "index out of bounds: the len is {} but the index is {}", len, index);
-    unsafe { intrinsics::abort() }
-}
-
-#[cfg(not(stage0))]
-#[cold]
-pub fn begin_unwind(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
-    #[allow(ctypes)]
-    extern {
-        #[lang = "begin_unwind"]
-        fn begin_unwind(fmt: &fmt::Arguments, file_line: &'static str,
-                        line: uint) -> !;
-    }
-    let (file, line) = *file_line;
-    unsafe { begin_unwind(fmt, file, line) }
-}