diff options
| author | bors <bors@rust-lang.org> | 2024-04-26 17:41:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-26 17:41:24 +0000 |
| commit | 4d570eea025a19564429eb52b34ec34e14659f55 (patch) | |
| tree | a265caa89ea72bd1b354e734fe629ed4f88e90a8 /library/alloc | |
| parent | 1b3a32958bb54bde45e693217e8f7469459e5865 (diff) | |
| parent | 61cf00464e311b3dcf1a47b342c57978b1f40d88 (diff) | |
| download | rust-4d570eea025a19564429eb52b34ec34e14659f55.tar.gz rust-4d570eea025a19564429eb52b34ec34e14659f55.zip | |
Auto merge of #123909 - dtolnay:utf8chunks, r=joboet
Stabilize `Utf8Chunks` Pending FCP in https://github.com/rust-lang/rust/issues/99543. This PR includes the proposed modification in https://github.com/rust-lang/libs-team/issues/190 as agreed in https://github.com/rust-lang/rust/issues/99543#issuecomment-2050406568.
Diffstat (limited to 'library/alloc')
| -rw-r--r-- | library/alloc/src/lib.rs | 1 | ||||
| -rw-r--r-- | library/alloc/src/str.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/string.rs | 4 |
3 files changed, 2 insertions, 5 deletions
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index b417513aaa2..2bd8fca7e01 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -161,7 +161,6 @@ #![feature(tuple_trait)] #![feature(unicode_internals)] #![feature(unsize)] -#![feature(utf8_chunks)] #![feature(vec_pop_if)] // tidy-alphabetical-end // diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs index ade114678b7..d88639c4092 100644 --- a/library/alloc/src/str.rs +++ b/library/alloc/src/str.rs @@ -53,7 +53,7 @@ pub use core::str::{RSplit, Split}; pub use core::str::{RSplitN, SplitN}; #[stable(feature = "rust1", since = "1.0.0")] pub use core::str::{RSplitTerminator, SplitTerminator}; -#[unstable(feature = "utf8_chunks", issue = "99543")] +#[stable(feature = "utf8_chunks", since = "CURRENT_RUSTC_VERSION")] pub use core::str::{Utf8Chunk, Utf8Chunks}; /// Note: `str` in `Concat<str>` is not meaningful here. diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 082af1447ec..7c9f13e30ff 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -58,8 +58,6 @@ use core::ops::{self, Range, RangeBounds}; use core::ptr; use core::slice; use core::str::pattern::Pattern; -#[cfg(not(no_global_oom_handling))] -use core::str::Utf8Chunks; #[cfg(not(no_global_oom_handling))] use crate::borrow::{Cow, ToOwned}; @@ -633,7 +631,7 @@ impl String { #[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] pub fn from_utf8_lossy(v: &[u8]) -> Cow<'_, str> { - let mut iter = Utf8Chunks::new(v); + let mut iter = v.utf8_chunks(); let first_valid = if let Some(chunk) = iter.next() { let valid = chunk.valid(); |
