Rollup merge of #137336 - riverbl:stabilise-os-str-display, r=tgross35
Stabilise `os_str_display` Closes #120048.
This commit is contained in:
commit
2dc7573edd
3 changed files with 5 additions and 8 deletions
|
@ -201,5 +201,5 @@ pub use self::c_str::{CStr, CString};
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use self::os_str::{OsStr, OsString};
|
pub use self::os_str::{OsStr, OsString};
|
||||||
|
|
||||||
#[unstable(feature = "os_str_display", issue = "120048")]
|
#[stable(feature = "os_str_display", since = "CURRENT_RUSTC_VERSION")]
|
||||||
pub mod os_str;
|
pub mod os_str;
|
||||||
|
|
|
@ -1204,13 +1204,12 @@ impl OsStr {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(os_str_display)]
|
|
||||||
/// use std::ffi::OsStr;
|
/// use std::ffi::OsStr;
|
||||||
///
|
///
|
||||||
/// let s = OsStr::new("Hello, world!");
|
/// let s = OsStr::new("Hello, world!");
|
||||||
/// println!("{}", s.display());
|
/// println!("{}", s.display());
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable(feature = "os_str_display", issue = "120048")]
|
#[stable(feature = "os_str_display", since = "CURRENT_RUSTC_VERSION")]
|
||||||
#[must_use = "this does not display the `OsStr`; \
|
#[must_use = "this does not display the `OsStr`; \
|
||||||
it returns an object that can be displayed"]
|
it returns an object that can be displayed"]
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -1559,7 +1558,6 @@ impl fmt::Debug for OsStr {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(os_str_display)]
|
|
||||||
/// use std::ffi::OsStr;
|
/// use std::ffi::OsStr;
|
||||||
///
|
///
|
||||||
/// let s = OsStr::new("Hello, world!");
|
/// let s = OsStr::new("Hello, world!");
|
||||||
|
@ -1568,19 +1566,19 @@ impl fmt::Debug for OsStr {
|
||||||
///
|
///
|
||||||
/// [`Display`]: fmt::Display
|
/// [`Display`]: fmt::Display
|
||||||
/// [`format!`]: crate::format
|
/// [`format!`]: crate::format
|
||||||
#[unstable(feature = "os_str_display", issue = "120048")]
|
#[stable(feature = "os_str_display", since = "CURRENT_RUSTC_VERSION")]
|
||||||
pub struct Display<'a> {
|
pub struct Display<'a> {
|
||||||
os_str: &'a OsStr,
|
os_str: &'a OsStr,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unstable(feature = "os_str_display", issue = "120048")]
|
#[stable(feature = "os_str_display", since = "CURRENT_RUSTC_VERSION")]
|
||||||
impl fmt::Debug for Display<'_> {
|
impl fmt::Debug for Display<'_> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
fmt::Debug::fmt(&self.os_str, f)
|
fmt::Debug::fmt(&self.os_str, f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unstable(feature = "os_str_display", issue = "120048")]
|
#[stable(feature = "os_str_display", since = "CURRENT_RUSTC_VERSION")]
|
||||||
impl fmt::Display for Display<'_> {
|
impl fmt::Display for Display<'_> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
fmt::Display::fmt(&self.os_str.inner, f)
|
fmt::Display::fmt(&self.os_str.inner, f)
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#![feature(iter_intersperse)]
|
#![feature(iter_intersperse)]
|
||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
#![feature(never_type)]
|
#![feature(never_type)]
|
||||||
#![feature(os_str_display)]
|
|
||||||
#![feature(round_char_boundary)]
|
#![feature(round_char_boundary)]
|
||||||
#![feature(test)]
|
#![feature(test)]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue