]> git.lizzy.rs Git - rust.git/commitdiff
Revert "Use fewer instructions for `fail!`"
authorBrian Anderson <banderson@mozilla.com>
Fri, 25 Jul 2014 22:57:15 +0000 (15:57 -0700)
committerBrian Anderson <banderson@mozilla.com>
Fri, 25 Jul 2014 22:57:15 +0000 (15:57 -0700)
This reverts commit c61f9763e2e03afbe62445877ceb3ed15e22e123.

Conflicts:
src/librustrt/unwind.rs
src/libstd/macros.rs

src/librustrt/lib.rs
src/librustrt/unwind.rs
src/libstd/macros.rs
src/libstd/rt/mod.rs

index e2d7f91d1a6f9b4bc258886d430c0d2d967e9968..b7b5e09a5562a197c38427bf20ef54897ce35a18 100644 (file)
@@ -33,7 +33,7 @@
 #[cfg(test)] #[phase(plugin, link)] extern crate std;
 
 pub use self::util::{Stdio, Stdout, Stderr};
-pub use self::unwind::{begin_unwind, begin_unwind_fmt, begin_unwind_no_time_to_explain};
+pub use self::unwind::{begin_unwind, begin_unwind_fmt};
 
 use core::prelude::*;
 
index db2cae2371821355b4adcba7b363a41852ce9eb4..5dfeb15afb84ad013f46c60562479d3e5ed5272b 100644 (file)
@@ -432,12 +432,6 @@ pub fn begin_unwind<M: Any + Send>(msg: M, file: &'static str, line: uint) -> !
     begin_unwind_inner(box msg, &(file, line))
 }
 
-/// Unwinding for `fail!()`. Saves passing a string.
-#[inline(never)] #[cold] #[experimental]
-pub fn begin_unwind_no_time_to_explain(file_line: &(&'static str, uint)) -> ! {
-    begin_unwind_inner(box () ("explicit failure"), file_line)
-}
-
 /// The core of the unwinding.
 ///
 /// This is non-generic to avoid instantiation bloat in other crates
index f3f47e3923d95e293102ce3a544a31164f3380c0..f0732c7d508e82a6b99d8f4cd4530c126ea2bee7 100644 (file)
 #[macro_export]
 macro_rules! fail(
     () => ({
-        // static requires less code at runtime, more constant data
-        static FILE_LINE: (&'static str, uint) = (file!(), line!());
-        ::std::rt::begin_unwind_no_time_to_explain(&FILE_LINE)
+        fail!("explicit failure")
     });
     ($msg:expr) => ({
+        // static requires less code at runtime, more constant data
         static FILE_LINE: (&'static str, uint) = (file!(), line!());
         let (file, line) = FILE_LINE;
         ::std::rt::begin_unwind($msg, file, line)
index 023a30de027a9c50628a36f6ce7d6dd25bee8f79..4490977bde619ef833f725c75af39cb9fa8ef796 100644 (file)
@@ -66,8 +66,7 @@
 // standard library which work together to create the entire runtime.
 pub use alloc::{heap, libc_heap};
 pub use rustrt::{task, local, mutex, exclusive, stack, args, rtio, thread};
-pub use rustrt::{Stdio, Stdout, Stderr};
-pub use rustrt::{begin_unwind, begin_unwind_fmt, begin_unwind_no_time_to_explain};
+pub use rustrt::{Stdio, Stdout, Stderr, begin_unwind, begin_unwind_fmt};
 pub use rustrt::{bookkeeping, at_exit, unwind, DEFAULT_ERROR_CODE, Runtime};
 
 // Simple backtrace functionality (to print on failure)