Skip to content

Commit 53a870c

Browse files
committed
Stabilize backtrace
1 parent 4493a0f commit 53a870c

File tree

7 files changed

+11
-15
lines changed

7 files changed

+11
-15
lines changed

compiler/rustc_errors/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
55
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
66
#![feature(drain_filter)]
7-
#![feature(backtrace)]
87
#![feature(if_let_guard)]
98
#![cfg_attr(bootstrap, feature(let_chains))]
109
#![feature(let_else)]

compiler/rustc_middle/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#![feature(allocator_api)]
2727
#![feature(array_windows)]
2828
#![feature(assert_matches)]
29-
#![feature(backtrace)]
3029
#![feature(box_patterns)]
3130
#![feature(core_intrinsics)]
3231
#![feature(discriminant_kind)]

library/std/src/backtrace.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
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
@@ -64,7 +58,7 @@
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.64.0")]
6862

6963
#[cfg(test)]
7064
mod 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.64.0")]
113108
#[must_use]
114109
pub 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.64.0")]
120116
#[non_exhaustive]
121117
#[derive(Debug, PartialEq, Eq)]
122118
pub enum BacktraceStatus {
@@ -174,6 +170,7 @@ enum BytesOrWide {
174170
Wide(Vec<u16>),
175171
}
176172

173+
#[stable(feature = "backtrace", since = "1.64.0")]
177174
impl 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")]
203201
impl 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.64.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.64.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.64.0")]
317+
#[rustc_const_stable(feature = "backtrace", since = "1.64.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.64.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.64.0")]
378382
impl fmt::Display for Backtrace {
379383
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
380384
let capture = match &self.inner {

library/std/src/error.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,6 @@ impl<E> Report<E> {
14541454
///
14551455
/// ```rust
14561456
/// #![feature(error_reporter)]
1457-
/// #![feature(backtrace)]
14581457
/// #![feature(provide_any)]
14591458
/// #![feature(error_generic_member_access)]
14601459
/// # use std::error::Error;

src/test/run-make-fulldeps/issue-47551/eh_frame-terminator.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22

3-
#![feature(backtrace)]
43
#[derive(Clone, Copy)]
54
struct Foo {
65
array: [u64; 10240],

src/test/ui/backtrace-apple-no-dsymutil.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
// compile-flags:-g -Csplit-debuginfo=unpacked
55
// only-macos
66

7-
#![feature(backtrace)]
8-
97
use std::process::Command;
108
use std::str;
119

src/test/ui/std-backtrace.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// compile-flags:-g
88
// compile-flags:-Cstrip=none
99

10-
#![feature(backtrace)]
11-
1210
use std::env;
1311
use std::process::Command;
1412
use std::str;

0 commit comments

Comments
 (0)