feat(std): Stabilize 'os_str_bytes' feature

Closes #111544
This commit is contained in:
Ed Page 2023-09-01 11:13:45 -05:00
parent 1accf068d8
commit 9aee1de612
2 changed files with 4 additions and 9 deletions

View File

@ -164,8 +164,6 @@ pub fn new() -> OsString {
/// # Example
///
/// ```
/// #![feature(os_str_bytes)]
///
/// use std::ffi::OsStr;
///
/// let os_str = OsStr::new("Mary had a little lamb");
@ -181,7 +179,7 @@ pub fn new() -> OsString {
///
/// [conversions]: super#conversions
#[inline]
#[unstable(feature = "os_str_bytes", issue = "111544")]
#[stable(feature = "os_str_bytes", since = "CURRENT_RUSTC_VERSION")]
pub unsafe fn from_os_str_bytes_unchecked(bytes: Vec<u8>) -> Self {
OsString { inner: Buf::from_os_str_bytes_unchecked(bytes) }
}
@ -219,7 +217,7 @@ pub fn as_os_str(&self) -> &OsStr {
///
/// [`std::ffi`]: crate::ffi
#[inline]
#[unstable(feature = "os_str_bytes", issue = "111544")]
#[stable(feature = "os_str_bytes", since = "CURRENT_RUSTC_VERSION")]
pub fn into_os_str_bytes(self) -> Vec<u8> {
self.inner.into_os_str_bytes()
}
@ -755,8 +753,6 @@ pub fn new<S: AsRef<OsStr> + ?Sized>(s: &S) -> &OsStr {
/// # Example
///
/// ```
/// #![feature(os_str_bytes)]
///
/// use std::ffi::OsStr;
///
/// let os_str = OsStr::new("Mary had a little lamb");
@ -772,7 +768,7 @@ pub fn new<S: AsRef<OsStr> + ?Sized>(s: &S) -> &OsStr {
///
/// [conversions]: super#conversions
#[inline]
#[unstable(feature = "os_str_bytes", issue = "111544")]
#[stable(feature = "os_str_bytes", since = "CURRENT_RUSTC_VERSION")]
pub unsafe fn from_os_str_bytes_unchecked(bytes: &[u8]) -> &Self {
Self::from_inner(Slice::from_os_str_bytes_unchecked(bytes))
}
@ -962,7 +958,7 @@ pub fn into_os_string(self: Box<OsStr>) -> OsString {
///
/// [`std::ffi`]: crate::ffi
#[inline]
#[unstable(feature = "os_str_bytes", issue = "111544")]
#[stable(feature = "os_str_bytes", since = "CURRENT_RUSTC_VERSION")]
pub fn as_os_str_bytes(&self) -> &[u8] {
self.inner.as_os_str_bytes()
}

View File

@ -8,7 +8,6 @@
#![feature(yeet_expr)]
#![feature(nonzero_ops)]
#![feature(round_ties_even)]
#![feature(os_str_bytes)]
#![feature(lint_reasons)]
#![feature(trait_upcasting)]
// Configure clippy and other lints