]> git.lizzy.rs Git - rust.git/commitdiff
std: Destabilize the internals of panic!
authorAlex Crichton <alex@alexcrichton.com>
Wed, 8 Apr 2015 22:48:46 +0000 (15:48 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 8 Apr 2015 22:48:46 +0000 (15:48 -0700)
Now that we have a `#[allow_internal_unstable]` attribute for macros there's no
need for these two `begin_unwind` functions to be stable. Right now the `panic!`
interface is the only one we wish to stabilize, so remove the stability markers
from these functions.

While this is a breaking change, it is highly unlikely to break any actual code.
It is recommended to use the `panic!` macro instead if it breaks explicit calls
into `std::rt`.

[breaking-change]
cc #24208

src/libstd/macros.rs
src/libstd/rt/unwind.rs

index b3d1adb44218a7e302037dd466640ece8a2039e0..3d10c151f80d6b4266375aa48ea747cca6543b48 100644 (file)
@@ -37,6 +37,7 @@
 /// ```
 #[macro_export]
 #[stable(feature = "rust1", since = "1.0.0")]
+#[allow_internal_unstable]
 macro_rules! panic {
     () => ({
         panic!("explicit panic")
index f71811b1eadf6f0c90567f684a872e9bb749d191..2f58a437eb4727992d192b058e58e2b6cef0aff1 100644 (file)
@@ -495,7 +495,6 @@ extern "C" fn inner(
 /// on (e.g.) the inlining of other functions as possible), by moving
 /// the actual formatting into this shared place.
 #[inline(never)] #[cold]
-#[stable(since = "1.0.0", feature = "rust1")]
 pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, usize)) -> ! {
     use fmt::Write;
 
@@ -511,7 +510,6 @@ pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, usize))
 
 /// This is the entry point of unwinding for panic!() and assert!().
 #[inline(never)] #[cold] // avoid code bloat at the call sites as much as possible
-#[stable(since = "1.0.0", feature = "rust1")]
 pub fn begin_unwind<M: Any + Send>(msg: M, file_line: &(&'static str, usize)) -> ! {
     // Note that this should be the only allocation performed in this code path.
     // Currently this means that panic!() on OOM will invoke this code path,
@@ -598,7 +596,6 @@ fn begin_unwind_inner(msg: Box<Any + Send>,
 /// Only a limited number of callbacks can be registered, and this function
 /// returns whether the callback was successfully registered or not. It is not
 /// currently possible to unregister a callback once it has been registered.
-#[unstable(feature = "std_misc")]
 pub unsafe fn register(f: Callback) -> bool {
     match CALLBACK_CNT.fetch_add(1, Ordering::SeqCst) {
         // The invocation code has knowledge of this window where the count has