Skip to content

Commit adb7984

Browse files
authored
Rollup merge of rust-lang#49121 - varkor:stabilise-from_utf8_error_as_bytes, r=bluss
Stabilise FromUtf8Error::as_bytes Closes rust-lang#40895.
2 parents c5264a5 + b57ea56 commit adb7984

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/liballoc/string.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1576,15 +1576,14 @@ impl FromUtf8Error {
15761576
/// Basic usage:
15771577
///
15781578
/// ```
1579-
/// #![feature(from_utf8_error_as_bytes)]
15801579
/// // some invalid bytes, in a vector
15811580
/// let bytes = vec![0, 159];
15821581
///
15831582
/// let value = String::from_utf8(bytes);
15841583
///
15851584
/// assert_eq!(&[0, 159], value.unwrap_err().as_bytes());
15861585
/// ```
1587-
#[unstable(feature = "from_utf8_error_as_bytes", reason = "recently added", issue = "40895")]
1586+
#[stable(feature = "from_utf8_error_as_bytes", since = "1.26.0")]
15881587
pub fn as_bytes(&self) -> &[u8] {
15891588
&self.bytes[..]
15901589
}

0 commit comments

Comments
 (0)