Skip to content

Commit 5cf80a8

Browse files
github-actions[bot]RalfJungChrisDentonmatthiaskrgrDaniPopes
authored
Merge subtree update for toolchain nightly-2025-04-21 (#336)
This is an automated PR to merge library subtree updates from 2025-04-07 (rust-lang/rust@2fa8b11) to 2025-04-21 (rust-lang/rust@b8c54d6) (inclusive) into main. `git merge` resulted in conflicts, which require manual resolution. Files were commited with merge conflict markers. **Do not remove or edit the following annotations:** git-subtree-dir: library git-subtree-split: 2ab28f3 --------- Signed-off-by: xizheyin <[email protected]> Signed-off-by: Petros Angelatos <[email protected]> Signed-off-by: Huang Qi <[email protected]> Signed-off-by: Ayush Singh <[email protected]> Signed-off-by: Alice Ryhl <[email protected]> Co-authored-by: Ralf Jung <[email protected]> Co-authored-by: Chris Denton <[email protected]> Co-authored-by: Matthias Krüger <[email protected]> Co-authored-by: DaniPopes <[email protected]> Co-authored-by: bors <[email protected]> Co-authored-by: Jacob Pratt <[email protected]> Co-authored-by: beetrees <[email protected]> Co-authored-by: Thalia Archibald <[email protected]> Co-authored-by: Mads Marquart <[email protected]> Co-authored-by: Christopher Durham <[email protected]> Co-authored-by: James Wainwright <[email protected]> Co-authored-by: joboet <[email protected]> Co-authored-by: Mara Bos <[email protected]> Co-authored-by: Rafael Bachmann <[email protected]> Co-authored-by: xizheyin <[email protected]> Co-authored-by: Benoît du Garreau <[email protected]> Co-authored-by: Nikolai Kuklin <[email protected]> Co-authored-by: Frank King <[email protected]> Co-authored-by: Daniel Henry-Mantilla <[email protected]> Co-authored-by: Scott McMurray <[email protected]> Co-authored-by: mejrs <[email protected]> Co-authored-by: okaneco <[email protected]> Co-authored-by: clubby789 <[email protected]> Co-authored-by: Takayuki Maeda <[email protected]> Co-authored-by: Daniel Bloom <[email protected]> Co-authored-by: Trevor Gross <[email protected]> Co-authored-by: Jake Wharton <[email protected]> Co-authored-by: bjorn3 <[email protected]> Co-authored-by: Guillaume Gomez <[email protected]> Co-authored-by: Kornel <[email protected]> Co-authored-by: Calder Coalson <[email protected]> Co-authored-by: Stuart Cook <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: izarma <[email protected]> Co-authored-by: Bennet Bleßmann <[email protected]> Co-authored-by: Celina G. Val <[email protected]> Co-authored-by: Jonathan Gruner <[email protected]> Co-authored-by: Stan Manilov <[email protected]> Co-authored-by: Gabriel Bjørnager Jensen <[email protected]> Co-authored-by: lincot <[email protected]> Co-authored-by: timesince <[email protected]> Co-authored-by: Boxy <[email protected]> Co-authored-by: oyvindln <[email protected]> Co-authored-by: Alice Ryhl <[email protected]> Co-authored-by: Folkert de Vries <[email protected]> Co-authored-by: Bastian Kersting <[email protected]> Co-authored-by: Petros Angelatos <[email protected]> Co-authored-by: Jesus Checa Hidalgo <[email protected]> Co-authored-by: Michael Howell <[email protected]> Co-authored-by: Ricardo Fernández Serrata <[email protected]> Co-authored-by: GenYuLi <[email protected]> Co-authored-by: Chris Denton <[email protected]> Co-authored-by: Amanieu d'Antras <[email protected]> Co-authored-by: Sky <[email protected]> Co-authored-by: Huang Qi <[email protected]> Co-authored-by: Ayush Singh <[email protected]> Co-authored-by: 0x79de <[email protected]> Co-authored-by: binarycat <[email protected]> Co-authored-by: Glyn Normington <[email protected]> Co-authored-by: Tamir Duberstein <[email protected]> Co-authored-by: Josh Triplett <[email protected]> Co-authored-by: Bastian Kersting <[email protected]> Co-authored-by: Lyndon Brown <[email protected]> Co-authored-by: Patrick Mooney <[email protected]> Co-authored-by: gitbot <git@bot> Co-authored-by: Michael Tautschnig <[email protected]>
1 parent 64af8ce commit 5cf80a8

File tree

172 files changed

+3195
-1767
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+3195
-1767
lines changed

library/Cargo.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

library/alloc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bench = false
1616

1717
[dependencies]
1818
core = { path = "../core", public = true }
19-
compiler_builtins = { version = "=0.1.152", features = ['rustc-dep-of-std'] }
19+
compiler_builtins = { version = "=0.1.155", features = ['rustc-dep-of-std'] }
2020
safety = { path = "../contracts/safety" }
2121

2222
[features]

library/alloc/src/alloc.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ unsafe extern "Rust" {
1616
// otherwise.
1717
#[rustc_allocator]
1818
#[rustc_nounwind]
19-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
19+
#[rustc_std_internal_symbol]
2020
fn __rust_alloc(size: usize, align: usize) -> *mut u8;
2121
#[rustc_deallocator]
2222
#[rustc_nounwind]
23-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
23+
#[rustc_std_internal_symbol]
2424
fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize);
2525
#[rustc_reallocator]
2626
#[rustc_nounwind]
27-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
27+
#[rustc_std_internal_symbol]
2828
fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8;
2929
#[rustc_allocator_zeroed]
3030
#[rustc_nounwind]
31-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
31+
#[rustc_std_internal_symbol]
3232
fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8;
3333

34-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
34+
#[rustc_std_internal_symbol]
3535
static __rust_no_alloc_shim_is_unstable: u8;
3636
}
3737

@@ -360,7 +360,7 @@ unsafe extern "Rust" {
360360
// This is the magic symbol to call the global alloc error handler. rustc generates
361361
// it to call `__rg_oom` if there is a `#[alloc_error_handler]`, or to call the
362362
// default implementations below (`__rdl_oom`) otherwise.
363-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
363+
#[rustc_std_internal_symbol]
364364
fn __rust_alloc_error_handler(size: usize, align: usize) -> !;
365365
}
366366

@@ -427,7 +427,7 @@ pub mod __alloc_error_handler {
427427
unsafe extern "Rust" {
428428
// This symbol is emitted by rustc next to __rust_alloc_error_handler.
429429
// Its value depends on the -Zoom={panic,abort} compiler option.
430-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
430+
#[rustc_std_internal_symbol]
431431
static __rust_alloc_error_handler_should_panic: u8;
432432
}
433433

library/alloc/src/boxed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
952952
/// assert_eq!(*x, i);
953953
/// }
954954
/// ```
955-
#[stable(feature = "box_uninit_write", since = "CURRENT_RUSTC_VERSION")]
955+
#[stable(feature = "box_uninit_write", since = "1.87.0")]
956956
#[inline]
957957
pub fn write(mut boxed: Self, value: T) -> Box<T, A> {
958958
unsafe {

library/alloc/src/collections/btree/set_val.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub(super) struct SetValZST;
99
/// Returns `true` only for type `SetValZST`, `false` for all other types (blanket implementation).
1010
/// `TypeId` requires a `'static` lifetime, use of this trait avoids that restriction.
1111
///
12-
/// [`TypeId`]: std::any::TypeId
12+
/// [`TypeId`]: core::any::TypeId
1313
pub(super) trait IsSetVal {
1414
fn is_set_val() -> bool;
1515
}

library/alloc/src/collections/linked_list.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ impl<T, A: Allocator> LinkedList<T, A> {
11511151
/// assert_eq!(evens.into_iter().collect::<Vec<_>>(), vec![2, 4, 6, 8, 14]);
11521152
/// assert_eq!(odds.into_iter().collect::<Vec<_>>(), vec![1, 3, 5, 9, 11, 13, 15]);
11531153
/// ```
1154-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1154+
#[stable(feature = "extract_if", since = "1.87.0")]
11551155
pub fn extract_if<F>(&mut self, filter: F) -> ExtractIf<'_, T, F, A>
11561156
where
11571157
F: FnMut(&mut T) -> bool,
@@ -1931,7 +1931,7 @@ impl<'a, T, A: Allocator> CursorMut<'a, T, A> {
19311931
}
19321932

19331933
/// An iterator produced by calling `extract_if` on LinkedList.
1934-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1934+
#[stable(feature = "extract_if", since = "1.87.0")]
19351935
#[must_use = "iterators are lazy and do nothing unless consumed"]
19361936
pub struct ExtractIf<
19371937
'a,
@@ -1946,7 +1946,7 @@ pub struct ExtractIf<
19461946
old_len: usize,
19471947
}
19481948

1949-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1949+
#[stable(feature = "extract_if", since = "1.87.0")]
19501950
impl<T, F, A: Allocator> Iterator for ExtractIf<'_, T, F, A>
19511951
where
19521952
F: FnMut(&mut T) -> bool,
@@ -1975,7 +1975,7 @@ where
19751975
}
19761976
}
19771977

1978-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1978+
#[stable(feature = "extract_if", since = "1.87.0")]
19791979
impl<T: fmt::Debug, F> fmt::Debug for ExtractIf<'_, T, F> {
19801980
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
19811981
f.debug_tuple("ExtractIf").field(&self.list).finish()

library/alloc/src/ffi/c_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ impl CStr {
11161116
/// with the corresponding <code>&[str]</code> slice. Otherwise, it will
11171117
/// replace any invalid UTF-8 sequences with
11181118
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD] and return a
1119-
/// <code>[Cow]::[Owned]\(&[str])</code> with the result.
1119+
/// <code>[Cow]::[Owned]\([String])</code> with the result.
11201120
///
11211121
/// [str]: prim@str "str"
11221122
/// [Borrowed]: Cow::Borrowed

library/alloc/src/fmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
//! parameters (corresponding to `format_spec` in [the syntax](#syntax)). These
110110
//! parameters affect the string representation of what's being formatted.
111111
//!
112-
//! The colon `:` in format syntax divides indentifier of the input data and
112+
//! The colon `:` in format syntax divides identifier of the input data and
113113
//! the formatting options, the colon itself does not change anything, only
114114
//! introduces the options.
115115
//!

library/alloc/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
#![feature(async_iterator)]
106106
#![feature(bstr)]
107107
#![feature(bstr_internals)]
108+
#![feature(char_internals)]
108109
#![feature(char_max_len)]
109110
#![feature(clone_to_uninit)]
110111
#![feature(coerce_unsized)]
@@ -136,6 +137,7 @@
136137
#![feature(pattern)]
137138
#![feature(pin_coerce_unsized_trait)]
138139
#![feature(pointer_like_trait)]
140+
#![feature(ptr_alignment_type)]
139141
#![feature(ptr_internals)]
140142
#![feature(ptr_metadata)]
141143
#![feature(set_ptr_value)]

library/alloc/src/raw_vec/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use core::marker::PhantomData;
88
use core::mem::{ManuallyDrop, MaybeUninit, SizedTypeProperties};
9-
use core::ptr::{self, NonNull, Unique};
9+
use core::ptr::{self, Alignment, NonNull, Unique};
1010
use core::{cmp, hint};
1111

1212
#[cfg(not(no_global_oom_handling))]
@@ -177,7 +177,7 @@ impl<T, A: Allocator> RawVec<T, A> {
177177
/// the returned `RawVec`.
178178
#[inline]
179179
pub(crate) const fn new_in(alloc: A) -> Self {
180-
Self { inner: RawVecInner::new_in(alloc, align_of::<T>()), _marker: PhantomData }
180+
Self { inner: RawVecInner::new_in(alloc, Alignment::of::<T>()), _marker: PhantomData }
181181
}
182182

183183
/// Like `with_capacity`, but parameterized over the choice of
@@ -409,8 +409,8 @@ unsafe impl<#[may_dangle] T, A: Allocator> Drop for RawVec<T, A> {
409409

410410
impl<A: Allocator> RawVecInner<A> {
411411
#[inline]
412-
const fn new_in(alloc: A, align: usize) -> Self {
413-
let ptr = unsafe { core::mem::transmute(align) };
412+
const fn new_in(alloc: A, align: Alignment) -> Self {
413+
let ptr = Unique::from_non_null(NonNull::without_provenance(align.as_nonzero()));
414414
// `cap: 0` means "unallocated". zero-sized types are ignored.
415415
Self { ptr, cap: ZERO_CAP, alloc }
416416
}
@@ -465,7 +465,7 @@ impl<A: Allocator> RawVecInner<A> {
465465

466466
// Don't allocate here because `Drop` will not deallocate when `capacity` is 0.
467467
if layout.size() == 0 {
468-
return Ok(Self::new_in(alloc, elem_layout.align()));
468+
return Ok(Self::new_in(alloc, elem_layout.alignment()));
469469
}
470470

471471
if let Err(err) = alloc_guard(layout.size()) {

library/alloc/src/string.rs

+57-28
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ impl String {
10431043
#[inline]
10441044
#[must_use = "`self` will be dropped if the result is not used"]
10451045
#[stable(feature = "rust1", since = "1.0.0")]
1046-
#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]
1046+
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
10471047
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
10481048
pub const fn into_bytes(self) -> Vec<u8> {
10491049
self.vec
@@ -1062,7 +1062,7 @@ impl String {
10621062
#[must_use]
10631063
#[stable(feature = "string_as_str", since = "1.7.0")]
10641064
#[rustc_diagnostic_item = "string_as_str"]
1065-
#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]
1065+
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
10661066
pub const fn as_str(&self) -> &str {
10671067
// SAFETY: String contents are stipulated to be valid UTF-8, invalid contents are an error
10681068
// at construction.
@@ -1085,7 +1085,7 @@ impl String {
10851085
#[must_use]
10861086
#[stable(feature = "string_as_str", since = "1.7.0")]
10871087
#[rustc_diagnostic_item = "string_as_mut_str"]
1088-
#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]
1088+
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
10891089
pub const fn as_mut_str(&mut self) -> &mut str {
10901090
// SAFETY: String contents are stipulated to be valid UTF-8, invalid contents are an error
10911091
// at construction.
@@ -1134,7 +1134,7 @@ impl String {
11341134
/// assert_eq!(string, "abcdecdeabecde");
11351135
/// ```
11361136
#[cfg(not(no_global_oom_handling))]
1137-
#[stable(feature = "string_extend_from_within", since = "CURRENT_RUSTC_VERSION")]
1137+
#[stable(feature = "string_extend_from_within", since = "1.87.0")]
11381138
pub fn extend_from_within<R>(&mut self, src: R)
11391139
where
11401140
R: RangeBounds<usize>,
@@ -1159,7 +1159,7 @@ impl String {
11591159
#[inline]
11601160
#[must_use]
11611161
#[stable(feature = "rust1", since = "1.0.0")]
1162-
#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]
1162+
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
11631163
pub const fn capacity(&self) -> usize {
11641164
self.vec.capacity()
11651165
}
@@ -1401,11 +1401,14 @@ impl String {
14011401
#[inline]
14021402
#[stable(feature = "rust1", since = "1.0.0")]
14031403
pub fn push(&mut self, ch: char) {
1404-
match ch.len_utf8() {
1405-
1 => self.vec.push(ch as u8),
1406-
_ => {
1407-
self.vec.extend_from_slice(ch.encode_utf8(&mut [0; char::MAX_LEN_UTF8]).as_bytes())
1408-
}
1404+
let len = self.len();
1405+
let ch_len = ch.len_utf8();
1406+
self.reserve(ch_len);
1407+
1408+
// SAFETY: Just reserved capacity for at least the length needed to encode `ch`.
1409+
unsafe {
1410+
core::char::encode_utf8_raw_unchecked(ch as u32, self.vec.as_mut_ptr().add(self.len()));
1411+
self.vec.set_len(len + ch_len);
14091412
}
14101413
}
14111414

@@ -1425,7 +1428,7 @@ impl String {
14251428
#[inline]
14261429
#[must_use]
14271430
#[stable(feature = "rust1", since = "1.0.0")]
1428-
#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]
1431+
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
14291432
pub const fn as_bytes(&self) -> &[u8] {
14301433
self.vec.as_slice()
14311434
}
@@ -1702,24 +1705,31 @@ impl String {
17021705
#[rustc_confusables("set")]
17031706
pub fn insert(&mut self, idx: usize, ch: char) {
17041707
assert!(self.is_char_boundary(idx));
1705-
let mut bits = [0; char::MAX_LEN_UTF8];
1706-
let bits = ch.encode_utf8(&mut bits).as_bytes();
17071708

1709+
let len = self.len();
1710+
let ch_len = ch.len_utf8();
1711+
self.reserve(ch_len);
1712+
1713+
// SAFETY: Move the bytes starting from `idx` to their new location `ch_len`
1714+
// bytes ahead. This is safe because sufficient capacity was reserved, and `idx`
1715+
// is a char boundary.
17081716
unsafe {
1709-
self.insert_bytes(idx, bits);
1717+
ptr::copy(
1718+
self.vec.as_ptr().add(idx),
1719+
self.vec.as_mut_ptr().add(idx + ch_len),
1720+
len - idx,
1721+
);
17101722
}
1711-
}
17121723

1713-
#[cfg(not(no_global_oom_handling))]
1714-
unsafe fn insert_bytes(&mut self, idx: usize, bytes: &[u8]) {
1715-
let len = self.len();
1716-
let amt = bytes.len();
1717-
self.vec.reserve(amt);
1724+
// SAFETY: Encode the character into the vacated region if `idx != len`,
1725+
// or into the uninitialized spare capacity otherwise.
1726+
unsafe {
1727+
core::char::encode_utf8_raw_unchecked(ch as u32, self.vec.as_mut_ptr().add(idx));
1728+
}
17181729

1730+
// SAFETY: Update the length to include the newly added bytes.
17191731
unsafe {
1720-
ptr::copy(self.vec.as_ptr().add(idx), self.vec.as_mut_ptr().add(idx + amt), len - idx);
1721-
ptr::copy_nonoverlapping(bytes.as_ptr(), self.vec.as_mut_ptr().add(idx), amt);
1722-
self.vec.set_len(len + amt);
1732+
self.vec.set_len(len + ch_len);
17231733
}
17241734
}
17251735

@@ -1749,8 +1759,27 @@ impl String {
17491759
pub fn insert_str(&mut self, idx: usize, string: &str) {
17501760
assert!(self.is_char_boundary(idx));
17511761

1762+
let len = self.len();
1763+
let amt = string.len();
1764+
self.reserve(amt);
1765+
1766+
// SAFETY: Move the bytes starting from `idx` to their new location `amt` bytes
1767+
// ahead. This is safe because sufficient capacity was just reserved, and `idx`
1768+
// is a char boundary.
1769+
unsafe {
1770+
ptr::copy(self.vec.as_ptr().add(idx), self.vec.as_mut_ptr().add(idx + amt), len - idx);
1771+
}
1772+
1773+
// SAFETY: Copy the new string slice into the vacated region if `idx != len`,
1774+
// or into the uninitialized spare capacity otherwise. The borrow checker
1775+
// ensures that the source and destination do not overlap.
1776+
unsafe {
1777+
ptr::copy_nonoverlapping(string.as_ptr(), self.vec.as_mut_ptr().add(idx), amt);
1778+
}
1779+
1780+
// SAFETY: Update the length to include the newly added bytes.
17521781
unsafe {
1753-
self.insert_bytes(idx, string.as_bytes());
1782+
self.vec.set_len(len + amt);
17541783
}
17551784
}
17561785

@@ -1779,7 +1808,7 @@ impl String {
17791808
/// ```
17801809
#[inline]
17811810
#[stable(feature = "rust1", since = "1.0.0")]
1782-
#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]
1811+
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
17831812
pub const unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8> {
17841813
&mut self.vec
17851814
}
@@ -1801,7 +1830,7 @@ impl String {
18011830
#[inline]
18021831
#[must_use]
18031832
#[stable(feature = "rust1", since = "1.0.0")]
1804-
#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]
1833+
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
18051834
#[rustc_confusables("length", "size")]
18061835
pub const fn len(&self) -> usize {
18071836
self.vec.len()
@@ -1821,7 +1850,7 @@ impl String {
18211850
#[inline]
18221851
#[must_use]
18231852
#[stable(feature = "rust1", since = "1.0.0")]
1824-
#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]
1853+
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
18251854
pub const fn is_empty(&self) -> bool {
18261855
self.len() == 0
18271856
}
@@ -3140,7 +3169,7 @@ impl From<String> for Vec<u8> {
31403169
}
31413170
}
31423171

3143-
#[stable(feature = "try_from_vec_u8_for_string", since = "CURRENT_RUSTC_VERSION")]
3172+
#[stable(feature = "try_from_vec_u8_for_string", since = "1.87.0")]
31443173
impl TryFrom<Vec<u8>> for String {
31453174
type Error = FromUtf8Error;
31463175
/// Converts the given [`Vec<u8>`] into a [`String`] if it contains valid UTF-8 data.

0 commit comments

Comments
 (0)