99//! implementing `std::error::Error`) to get a causal chain of where an error
1010//! was generated.
1111//!
12- //! > **Note**: this module is unstable and is designed in [RFC 2504], and you
13- //! > can learn more about its status in the [tracking issue].
14- //!
15- //! [RFC 2504]: https://github.com/rust-lang/rfcs/blob/master/text/2504-fix-error.md
16- //! [tracking issue]: https://github.com/rust-lang/rust/issues/53487
17- //!
1812//! ## Accuracy
1913//!
2014//! Backtraces are attempted to be as accurate as possible, but no guarantees
6458//! `RUST_LIB_BACKTRACE` or `RUST_BACKTRACE` at runtime might not actually change
6559//! how backtraces are captured.
6660
67- #![ unstable ( feature = "backtrace" , issue = "53487 " ) ]
61+ #![ stable ( feature = "backtrace" , since = "1.65.0 " ) ]
6862
6963#[ cfg( test) ]
7064mod tests;
@@ -110,13 +104,15 @@ use crate::vec::Vec;
110104/// previous point in time. In some instances the `Backtrace` type may
111105/// internally be empty due to configuration. For more information see
112106/// `Backtrace::capture`.
107+ #[ stable( feature = "backtrace" , since = "1.65.0" ) ]
113108#[ must_use]
114109pub struct Backtrace {
115110 inner : Inner ,
116111}
117112
118113/// The current status of a backtrace, indicating whether it was captured or
119114/// whether it is empty for some other reason.
115+ #[ stable( feature = "backtrace" , since = "1.65.0" ) ]
120116#[ non_exhaustive]
121117#[ derive( Debug , PartialEq , Eq ) ]
122118pub enum BacktraceStatus {
@@ -174,6 +170,7 @@ enum BytesOrWide {
174170 Wide ( Vec < u16 > ) ,
175171}
176172
173+ #[ stable( feature = "backtrace" , since = "1.65.0" ) ]
177174impl fmt:: Debug for Backtrace {
178175 fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
179176 let capture = match & self . inner {
@@ -200,6 +197,7 @@ impl fmt::Debug for Backtrace {
200197 }
201198}
202199
200+ #[ unstable( feature = "backtrace_frames" , issue = "79676" ) ]
203201impl fmt:: Debug for BacktraceFrame {
204202 fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
205203 let mut dbg = fmt. debug_list ( ) ;
@@ -288,6 +286,7 @@ impl Backtrace {
288286 ///
289287 /// To forcibly capture a backtrace regardless of environment variables, use
290288 /// the `Backtrace::force_capture` function.
289+ #[ stable( feature = "backtrace" , since = "1.65.0" ) ]
291290 #[ inline( never) ] // want to make sure there's a frame here to remove
292291 pub fn capture ( ) -> Backtrace {
293292 if !Backtrace :: enabled ( ) {
@@ -306,13 +305,16 @@ impl Backtrace {
306305 /// Note that capturing a backtrace can be an expensive operation on some
307306 /// platforms, so this should be used with caution in performance-sensitive
308307 /// parts of code.
308+ #[ stable( feature = "backtrace" , since = "1.65.0" ) ]
309309 #[ inline( never) ] // want to make sure there's a frame here to remove
310310 pub fn force_capture ( ) -> Backtrace {
311311 Backtrace :: create ( Backtrace :: force_capture as usize )
312312 }
313313
314314 /// Forcibly captures a disabled backtrace, regardless of environment
315315 /// variable configuration.
316+ #[ stable( feature = "backtrace" , since = "1.65.0" ) ]
317+ #[ rustc_const_stable( feature = "backtrace" , since = "1.65.0" ) ]
316318 pub const fn disabled ( ) -> Backtrace {
317319 Backtrace { inner : Inner :: Disabled }
318320 }
@@ -356,6 +358,7 @@ impl Backtrace {
356358 /// Returns the status of this backtrace, indicating whether this backtrace
357359 /// request was unsupported, disabled, or a stack trace was actually
358360 /// captured.
361+ #[ stable( feature = "backtrace" , since = "1.65.0" ) ]
359362 #[ must_use]
360363 pub fn status ( & self ) -> BacktraceStatus {
361364 match self . inner {
@@ -375,6 +378,7 @@ impl<'a> Backtrace {
375378 }
376379}
377380
381+ #[ stable( feature = "backtrace" , since = "1.65.0" ) ]
378382impl fmt:: Display for Backtrace {
379383 fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
380384 let capture = match & self . inner {
0 commit comments