about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2014-09-21 23:35:43 +0200
committerFlorian Hahn <flo@fhahn.com>2014-09-25 01:09:09 +0200
commit1c7d253ca3601d2f9caddc52e66bfc1de3bdd441 (patch)
tree4d28ead07c0451d6038972ed6517a817e7230554 /src/libcore
parent45f4081e61a1a15e2b5b9c5a09976fddffdac9dc (diff)
downloadrust-1c7d253ca3601d2f9caddc52e66bfc1de3bdd441.tar.gz
rust-1c7d253ca3601d2f9caddc52e66bfc1de3bdd441.zip
Rename `fail_` lang item to `fail`, closes #16114
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/failure.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/libcore/failure.rs b/src/libcore/failure.rs
index 8cea7abe963..6f919004874 100644
--- a/src/libcore/failure.rs
+++ b/src/libcore/failure.rs
@@ -33,6 +33,8 @@
 use fmt;
 use intrinsics;
 
+// NOTE: remove after next snapshot
+#[cfg(stage0)]
 #[cold] #[inline(never)] // this is the slow path, always
 #[lang="fail_"]
 fn fail_(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
@@ -45,6 +47,19 @@ fn fail_(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
     unsafe { intrinsics::abort() }
 }
 
+#[cfg(not(stage0))]
+#[cold] #[inline(never)] // this is the slow path, always
+#[lang="fail"]
+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);
+    }, "{}", expr);
+
+    unsafe { intrinsics::abort() }
+}
+
 #[cold] #[inline(never)]
 #[lang="fail_bounds_check"]
 fn fail_bounds_check(file_line: &(&'static str, uint),
@@ -65,6 +80,7 @@ pub fn fail_impl(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
     #[allow(ctypes)]
     extern {
 
+        // NOTE: remove after next snapshot
         #[cfg(stage0)]
         #[lang = "begin_unwind"]
         fn fail_impl(fmt: &fmt::Arguments, file: &'static str,
@@ -79,4 +95,3 @@ pub fn fail_impl(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
     let (file, line) = *file_line;
     unsafe { fail_impl(fmt, file, line) }
 }
-