Skip to content

Commit

Permalink
feat(std): Stabilize 'os_str_bytes' feature
Browse files Browse the repository at this point in the history
Closes #111544
  • Loading branch information
epage committed Sep 1, 2023
1 parent 1accf06 commit 9aee1de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
12 changes: 4 additions & 8 deletions library/std/src/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ impl OsString {
/// # Example
///
/// ```
/// #![feature(os_str_bytes)]
///
/// use std::ffi::OsStr;
///
/// let os_str = OsStr::new("Mary had a little lamb");
Expand All @@ -181,7 +179,7 @@ impl 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) }
}
Expand Down Expand Up @@ -219,7 +217,7 @@ impl OsString {
///
/// [`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()
}
Expand Down Expand Up @@ -755,8 +753,6 @@ impl OsStr {
/// # Example
///
/// ```
/// #![feature(os_str_bytes)]
///
/// use std::ffi::OsStr;
///
/// let os_str = OsStr::new("Mary had a little lamb");
Expand All @@ -772,7 +768,7 @@ impl 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))
}
Expand Down Expand Up @@ -962,7 +958,7 @@ impl OsStr {
///
/// [`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()
}
Expand Down
1 change: 0 additions & 1 deletion src/tools/miri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9aee1de

Please sign in to comment.