Rollup of 5 pull requests#159510
Closed
JonathanBrouwer wants to merge 10 commits into
Closed
Conversation
The `scoped_two_small_structs` test expects `sub sp, sp, rust-lang#48` on aarch64, which assumes the frame pointer (x29) is saved. Custom targets that don't set `frame-pointer: non-leaf` (e.g., OpenEmbedded/Yocto's `aarch64-poky-linux-gnu`) omit x29, producing `sub sp, sp, rust-lang#32` instead. Add `-Cforce-frame-pointers=yes` to the aarch64 revision so the test produces consistent codegen regardless of the target's default frame pointer policy. Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
In the early days of Unicode, many systems adopted it by storing in-memory strings in (roughly) `Vec<u16>`, encoded as UCS-2 / UTF-16 / WTF-16. The “natural” way to index such strings or measure their length is counting UTF-16 code units. In some cases, such lengths or offsets found their way in protocols or APIs, such that even a Rust implementation that uses `&str` internally needs to count 16-bit code units for compatibility. For example this comes up in Servo’s implementation of some DOM APIs. One way to convert from an `&str` index (counted 8-bit code units) is: ```rust let index_16bit = string[..i].encode_utf16().count(); ``` Before this PR, the default `Iterator::count` relies on `Iterator::next` which decodes UTF-8 and encodes to UTF-16, doing more work than needed. Instead, this PR matches on bit patterns in the underlying UTF-8 string. For comparison, `str::Chars` already has a sophisticated impl for `Iterator::count` in `library/core/src/str/count.rs`.
…oboet Add explicit `Iterator::count` impl for `str::EncodeUtf16` In the early days of Unicode, many systems adopted it by storing in-memory strings in (roughly) `Vec<u16>`, encoded as UCS-2 / UTF-16 / WTF-16. The “natural” way to index such strings or measure their length is counting UTF-16 code units. In some cases, such lengths or offsets found their way in protocols or APIs, such that even a Rust implementation that uses `&str` internally needs to count 16-bit code units for compatibility. For example this comes up in Servo’s implementation of some DOM APIs. One way to convert from an `&str` index (counted 8-bit code units) is: ```rust let index_16bit = string[..i].encode_utf16().count(); ``` Before this PR, the default `Iterator::count` relies on `Iterator::next` which decodes UTF-8 and encodes to UTF-16, doing more work than needed. Instead, this PR matches on bit patterns in the underlying UTF-8 string. For comparison, `str::Chars` already has a sophisticated impl for `Iterator::count` in `library/core/src/str/count.rs`.
…ing, r=clarfonthey Move `std::io::read_to_string` to `alloc::io` ACP: rust-lang/libs-team#755 Tracking issue: rust-lang#154046 Split From: rust-lang#156527 ~~Blocked On: rust-lang#158544 ## Description Moves `std::io::read_to_string` to `alloc::io`. This is a trivial move. Blocked on rust-lang#158544. --- ## Notes * No AI tooling of any kind was used during the creation of this PR. * Please see rust-lang#154046 (comment) for a review order and broader context for this PR.
…arch64-stack-check, r=mati865 tests/assembly-llvm: pin frame pointer in issue-141649 aarch64 test The `scoped_two_small_structs` test expects `sub sp, sp, rust-lang#48` on aarch64, which assumes the frame pointer (x29) is saved. Custom targets that don't set `frame-pointer: non-leaf` (e.g., OpenEmbedded/Yocto's `aarch64-poky-linux-gnu`) omit x29, producing `sub sp, sp, rust-lang#32` instead. Add `-Cforce-frame-pointers=yes` to the aarch64 revision so the test produces consistent codegen regardless of the target's default frame pointer policy.
Fix string indexing in diagnostic format strings Fixes rust-lang#159252 This also affects beta.
…youxu Move compiletest CLI parsing to `cli.rs` Separated out of rust-lang#159451.
Contributor
Author
|
@bors r+ rollup=never p=5 |
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 18, 2026
…uwer Rollup of 5 pull requests Successful merges: - #159467 (Add explicit `Iterator::count` impl for `str::EncodeUtf16`) - #158545 (Move `std::io::read_to_string` to `alloc::io`) - #159328 (tests/assembly-llvm: pin frame pointer in issue-141649 aarch64 test) - #159470 (Fix string indexing in diagnostic format strings) - #159500 (Move compiletest CLI parsing to `cli.rs`)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot)Important For more information how to resolve CI failures of this job, visit this link. |
Contributor
|
💔 Test for 6fd20b5 failed: CI. Failed job:
|
Contributor
|
This pull request was unapproved due to being closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
Iterator::countimpl forstr::EncodeUtf16#159467 (Add explicitIterator::countimpl forstr::EncodeUtf16)std::io::read_to_stringtoalloc::io#158545 (Movestd::io::read_to_stringtoalloc::io)cli.rs#159500 (Move compiletest CLI parsing tocli.rs)r? @ghost
Create a similar rollup