From 6ddcf5044b64a03fc8fc422cdfa9946abd42c8f0 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 26 Nov 2019 09:24:17 +0100 Subject: [PATCH 1/3] Fix unstable attribute accidentally applying to the entire impl Note `#![unstable]` v.s. `#[unstable]` --- src/libcore/panic.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libcore/panic.rs b/src/libcore/panic.rs index cdd38449a1be2..b61877ab070da 100644 --- a/src/libcore/panic.rs +++ b/src/libcore/panic.rs @@ -39,10 +39,10 @@ pub struct PanicInfo<'a> { } impl<'a> PanicInfo<'a> { - #![unstable(feature = "panic_internals", - reason = "internal details of the implementation of the `panic!` \ - and related macros", - issue = "0")] + #[unstable(feature = "panic_internals", + reason = "internal details of the implementation of the `panic!` \ + and related macros", + issue = "0")] #[doc(hidden)] #[inline] pub fn internal_constructor( @@ -57,6 +57,10 @@ impl<'a> PanicInfo<'a> { } } + #[unstable(feature = "panic_internals", + reason = "internal details of the implementation of the `panic!` \ + and related macros", + issue = "0")] #[doc(hidden)] #[inline] pub fn set_payload(&mut self, info: &'a (dyn Any + Send)) { From 392e5a7150d0a7c0098631d92791a26013ba28cd Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 26 Nov 2019 10:19:09 +0100 Subject: [PATCH 2/3] Fix the tracking issue number for `PanicInfo::message` #44489 was closed when the `#[panic_handler]` attribute was stabilized. --- src/libcore/panic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/panic.rs b/src/libcore/panic.rs index b61877ab070da..aa81a7d402d0a 100644 --- a/src/libcore/panic.rs +++ b/src/libcore/panic.rs @@ -94,7 +94,7 @@ impl<'a> PanicInfo<'a> { /// returns that message ready to be used for example with [`fmt::write`] /// /// [`fmt::write`]: ../fmt/fn.write.html - #[unstable(feature = "panic_info_message", issue = "44489")] + #[unstable(feature = "panic_info_message", issue = "66745")] pub fn message(&self) -> Option<&fmt::Arguments<'_>> { self.message } From eab1dc9b562c4ff128575d6af7afe819e34f9340 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 26 Nov 2019 10:47:08 +0100 Subject: [PATCH 3/3] Stabilize the `core::panic` module `std::panic` is already stable. `core::panic::PanicInfo` and `core::panic::Location` are stable and can be used through that path because of a bug in stability checking: https://github.com/rust-lang/rust/issues/15702 --- src/libcore/panic.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libcore/panic.rs b/src/libcore/panic.rs index aa81a7d402d0a..6185f11e466f0 100644 --- a/src/libcore/panic.rs +++ b/src/libcore/panic.rs @@ -1,8 +1,6 @@ //! Panic support in the standard library. -#![unstable(feature = "core_panic_info", - reason = "newly available in libcore", - issue = "44489")] +#![stable(feature = "core_panic_info", since = "1.41.0")] use crate::any::Any; use crate::fmt;