diff options
| author | bors <bors@rust-lang.org> | 2022-08-27 16:57:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-08-27 16:57:19 +0000 |
| commit | eaadb8947b850a025404082f6297766c4680a42a (patch) | |
| tree | 18ace630fe710347223eb01bb339be5f28635d30 /library/std/src | |
| parent | 332cc8fb752fe98c21837ed6f3571f6adb0d08b8 (diff) | |
| parent | d32ff14b86c72f55a113a3f477c42b2995e8c620 (diff) | |
| download | rust-eaadb8947b850a025404082f6297766c4680a42a.tar.gz rust-eaadb8947b850a025404082f6297766c4680a42a.zip | |
Auto merge of #100591 - est31:stabilization_placeholder, r=Mark-Simulacrum
Require stabilizations to use a placeholder instead of writing out stabilization version Implements the idea from [this](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/libs.20stabilization.20placeholder) zulip stream. It's a common phenomenon that feature stabilizations don't make it into a particular release, but the version is still inaccurate. Often this is caught in the PR, but it can also require subsequent changes to adjust/correct the version. A list with examples of such PRs is given in #100577, but it's far from complete. This PR requires stabilization PRs to use the placeholder `CURRENT_RUSTC_VERSION`, enforced via tidy tooling. The PR also adds a tool that replaces the placeholder with the version number. It can be invoked via `./x.py run src/tools/replace-version-placeholder` and is supposed to be ran upon beta branching as well as version bumping and any backports to the beta branch. I filed PRs to the dev guide and forge to document these changes in the release and stabilization workflows: * The [dev guide](https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#determining-the-stabilization-version) PR: https://github.com/rust-lang/rustc-dev-guide/pull/1443 * The [std dev guide](https://std-dev-guide.rust-lang.org/) PR: https://github.com/rust-lang/std-dev-guide/pull/43 * The [forge](https://github.com/rust-lang/rust-forge) PR: https://github.com/rust-lang/rust-forge/pull/643 Alternative to #100577 which added checking.
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/backtrace.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/library/std/src/backtrace.rs b/library/std/src/backtrace.rs index 5cf6ec81789..354200d4c95 100644 --- a/library/std/src/backtrace.rs +++ b/library/std/src/backtrace.rs @@ -58,7 +58,7 @@ //! `RUST_LIB_BACKTRACE` or `RUST_BACKTRACE` at runtime might not actually change //! how backtraces are captured. -#![stable(feature = "backtrace", since = "1.65.0")] +#![stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] #[cfg(test)] mod tests; @@ -104,7 +104,7 @@ use crate::vec::Vec; /// previous point in time. In some instances the `Backtrace` type may /// internally be empty due to configuration. For more information see /// `Backtrace::capture`. -#[stable(feature = "backtrace", since = "1.65.0")] +#[stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] #[must_use] pub struct Backtrace { inner: Inner, @@ -112,21 +112,21 @@ pub struct Backtrace { /// The current status of a backtrace, indicating whether it was captured or /// whether it is empty for some other reason. -#[stable(feature = "backtrace", since = "1.65.0")] +#[stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] #[non_exhaustive] #[derive(Debug, PartialEq, Eq)] pub enum BacktraceStatus { /// Capturing a backtrace is not supported, likely because it's not /// implemented for the current platform. - #[stable(feature = "backtrace", since = "1.65.0")] + #[stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] Unsupported, /// Capturing a backtrace has been disabled through either the /// `RUST_LIB_BACKTRACE` or `RUST_BACKTRACE` environment variables. - #[stable(feature = "backtrace", since = "1.65.0")] + #[stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] Disabled, /// A backtrace has been captured and the `Backtrace` should print /// reasonable information when rendered. - #[stable(feature = "backtrace", since = "1.65.0")] + #[stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] Captured, } @@ -173,7 +173,7 @@ enum BytesOrWide { Wide(Vec<u16>), } -#[stable(feature = "backtrace", since = "1.65.0")] +#[stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] impl fmt::Debug for Backtrace { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let capture = match &self.inner { @@ -289,7 +289,7 @@ impl Backtrace { /// /// To forcibly capture a backtrace regardless of environment variables, use /// the `Backtrace::force_capture` function. - #[stable(feature = "backtrace", since = "1.65.0")] + #[stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] #[inline(never)] // want to make sure there's a frame here to remove pub fn capture() -> Backtrace { if !Backtrace::enabled() { @@ -308,7 +308,7 @@ impl Backtrace { /// Note that capturing a backtrace can be an expensive operation on some /// platforms, so this should be used with caution in performance-sensitive /// parts of code. - #[stable(feature = "backtrace", since = "1.65.0")] + #[stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] #[inline(never)] // want to make sure there's a frame here to remove pub fn force_capture() -> Backtrace { Backtrace::create(Backtrace::force_capture as usize) @@ -316,8 +316,8 @@ impl Backtrace { /// Forcibly captures a disabled backtrace, regardless of environment /// variable configuration. - #[stable(feature = "backtrace", since = "1.65.0")] - #[rustc_const_stable(feature = "backtrace", since = "1.65.0")] + #[stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] pub const fn disabled() -> Backtrace { Backtrace { inner: Inner::Disabled } } @@ -361,7 +361,7 @@ impl Backtrace { /// Returns the status of this backtrace, indicating whether this backtrace /// request was unsupported, disabled, or a stack trace was actually /// captured. - #[stable(feature = "backtrace", since = "1.65.0")] + #[stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] #[must_use] pub fn status(&self) -> BacktraceStatus { match self.inner { @@ -381,7 +381,7 @@ impl<'a> Backtrace { } } -#[stable(feature = "backtrace", since = "1.65.0")] +#[stable(feature = "backtrace", since = "CURRENT_RUSTC_VERSION")] impl fmt::Display for Backtrace { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let capture = match &self.inner { |
