diff options
| author | Ralf Jung <post@ralfj.de> | 2024-11-02 12:01:56 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-11-03 07:49:24 +0100 |
| commit | 234d3de8b441a9596e929e57d00d3c38560c5262 (patch) | |
| tree | 35da4abbb96b53893362e5bac506a105b680a9ae | |
| parent | 67395551d07b0eaf6a45ed3bf1759530ca2235d7 (diff) | |
stabilize const_arguments_as_str
| -rw-r--r-- | library/core/src/fmt/mod.rs | 3 | ||||
| -rw-r--r-- | library/core/src/lib.rs | 1 | ||||
| -rw-r--r-- | library/core/src/panic/panic_info.rs | 3 |
3 files changed, 2 insertions, 5 deletions
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index f3b54230bc1..2b1692a195e 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -438,10 +438,9 @@ impl<'a> Arguments<'a> { /// assert_eq!(format_args!("{:?}", std::env::current_dir()).as_str(), None); /// ``` #[stable(feature = "fmt_as_str", since = "1.52.0")] - #[rustc_const_unstable(feature = "const_arguments_as_str", issue = "103900")] + #[rustc_const_stable(feature = "const_arguments_as_str", since = "CURRENT_RUSTC_VERSION")] #[must_use] #[inline] - #[cfg_attr(not(bootstrap), rustc_const_stable_indirect)] pub const fn as_str(&self) -> Option<&'static str> { match (self.pieces, self.args) { ([], []) => Some(""), diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index bbfe32027e8..886192bfe5e 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -114,7 +114,6 @@ #![feature(const_align_of_val_raw)] #![feature(const_align_offset)] #![feature(const_alloc_layout)] -#![feature(const_arguments_as_str)] #![feature(const_black_box)] #![feature(const_char_encode_utf16)] #![feature(const_eval_select)] diff --git a/library/core/src/panic/panic_info.rs b/library/core/src/panic/panic_info.rs index 1d950eb3625..230a9918dbf 100644 --- a/library/core/src/panic/panic_info.rs +++ b/library/core/src/panic/panic_info.rs @@ -165,10 +165,9 @@ impl<'a> PanicMessage<'a> { /// /// See [`fmt::Arguments::as_str`] for details. #[stable(feature = "panic_info_message", since = "1.81.0")] - #[rustc_const_unstable(feature = "const_arguments_as_str", issue = "103900")] + #[rustc_const_stable(feature = "const_arguments_as_str", since = "CURRENT_RUSTC_VERSION")] #[must_use] #[inline] - #[cfg_attr(not(bootstrap), rustc_const_stable_indirect)] pub const fn as_str(&self) -> Option<&'static str> { self.message.as_str() } |
