Skip to content

Commit 65e3f03

Browse files
committed
std: Destabilize the internals of panic!
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
1 parent 926f38e commit 65e3f03

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/libstd/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
/// ```
3838
#[macro_export]
3939
#[stable(feature = "rust1", since = "1.0.0")]
40+
#[allow_internal_unstable]
4041
macro_rules! panic {
4142
() => ({
4243
panic!("explicit panic")

src/libstd/rt/unwind.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ pub extern fn rust_begin_unwind(msg: fmt::Arguments,
495495
/// on (e.g.) the inlining of other functions as possible), by moving
496496
/// the actual formatting into this shared place.
497497
#[inline(never)] #[cold]
498-
#[stable(since = "1.0.0", feature = "rust1")]
499498
pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, usize)) -> ! {
500499
use fmt::Write;
501500

@@ -511,7 +510,6 @@ pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, usize))
511510

512511
/// This is the entry point of unwinding for panic!() and assert!().
513512
#[inline(never)] #[cold] // avoid code bloat at the call sites as much as possible
514-
#[stable(since = "1.0.0", feature = "rust1")]
515513
pub fn begin_unwind<M: Any + Send>(msg: M, file_line: &(&'static str, usize)) -> ! {
516514
// Note that this should be the only allocation performed in this code path.
517515
// Currently this means that panic!() on OOM will invoke this code path,
@@ -598,7 +596,6 @@ fn begin_unwind_inner(msg: Box<Any + Send>,
598596
/// Only a limited number of callbacks can be registered, and this function
599597
/// returns whether the callback was successfully registered or not. It is not
600598
/// currently possible to unregister a callback once it has been registered.
601-
#[unstable(feature = "std_misc")]
602599
pub unsafe fn register(f: Callback) -> bool {
603600
match CALLBACK_CNT.fetch_add(1, Ordering::SeqCst) {
604601
// The invocation code has knowledge of this window where the count has

0 commit comments

Comments
 (0)