1
Fork 0

Rollup merge of #82120 - sfackler:arguments-as-str, r=dtolnay

Stabilize Arguments::as_str

Closes #74442
This commit is contained in:
Jonas Schievink 2021-02-15 16:07:08 +01:00 committed by GitHub
commit c87ef218f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View file

@ -401,8 +401,6 @@ impl<'a> Arguments<'a> {
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
/// #![feature(fmt_as_str)]
///
/// use std::fmt::Arguments; /// use std::fmt::Arguments;
/// ///
/// fn write_str(_: &str) { /* ... */ } /// fn write_str(_: &str) { /* ... */ }
@ -417,13 +415,11 @@ impl<'a> Arguments<'a> {
/// ``` /// ```
/// ///
/// ```rust /// ```rust
/// #![feature(fmt_as_str)]
///
/// assert_eq!(format_args!("hello").as_str(), Some("hello")); /// assert_eq!(format_args!("hello").as_str(), Some("hello"));
/// assert_eq!(format_args!("").as_str(), Some("")); /// assert_eq!(format_args!("").as_str(), Some(""));
/// assert_eq!(format_args!("{}", 1).as_str(), None); /// assert_eq!(format_args!("{}", 1).as_str(), None);
/// ``` /// ```
#[unstable(feature = "fmt_as_str", issue = "74442")] #[stable(feature = "fmt_as_str", since = "1.52.0")]
#[inline] #[inline]
pub fn as_str(&self) -> Option<&'static str> { pub fn as_str(&self) -> Option<&'static str> {
match (self.pieces, self.args) { match (self.pieces, self.args) {

View file

@ -264,7 +264,6 @@
#![feature(exhaustive_patterns)] #![feature(exhaustive_patterns)]
#![feature(extend_one)] #![feature(extend_one)]
#![feature(external_doc)] #![feature(external_doc)]
#![feature(fmt_as_str)]
#![feature(fn_traits)] #![feature(fn_traits)]
#![feature(format_args_nl)] #![feature(format_args_nl)]
#![feature(gen_future)] #![feature(gen_future)]