Skip to content

Commit d420d94

Browse files
Rollup merge of rust-lang#132511 - RalfJung:const_arguments_as_str, r=dtolnay
stabilize const_arguments_as_str FCP passed in the [tracking issue](rust-lang#103900 (comment)).
2 parents 4ab4fd2 + 19673db commit d420d94

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

library/core/src/fmt/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,9 @@ impl<'a> Arguments<'a> {
438438
/// assert_eq!(format_args!("{:?}", std::env::current_dir()).as_str(), None);
439439
/// ```
440440
#[stable(feature = "fmt_as_str", since = "1.52.0")]
441-
#[rustc_const_unstable(feature = "const_arguments_as_str", issue = "103900")]
441+
#[rustc_const_stable(feature = "const_arguments_as_str", since = "CURRENT_RUSTC_VERSION")]
442442
#[must_use]
443443
#[inline]
444-
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
445444
pub const fn as_str(&self) -> Option<&'static str> {
446445
match (self.pieces, self.args) {
447446
([], []) => Some(""),

library/core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
#![feature(const_align_of_val_raw)]
115115
#![feature(const_align_offset)]
116116
#![feature(const_alloc_layout)]
117-
#![feature(const_arguments_as_str)]
118117
#![feature(const_array_into_iter_constructors)]
119118
#![feature(const_bigint_helper_methods)]
120119
#![feature(const_black_box)]

library/core/src/panic/panic_info.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,9 @@ impl<'a> PanicMessage<'a> {
165165
///
166166
/// See [`fmt::Arguments::as_str`] for details.
167167
#[stable(feature = "panic_info_message", since = "1.81.0")]
168-
#[rustc_const_unstable(feature = "const_arguments_as_str", issue = "103900")]
168+
#[rustc_const_stable(feature = "const_arguments_as_str", since = "CURRENT_RUSTC_VERSION")]
169169
#[must_use]
170170
#[inline]
171-
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
172171
pub const fn as_str(&self) -> Option<&'static str> {
173172
self.message.as_str()
174173
}

0 commit comments

Comments
 (0)