Rollup of 5 pull requests#159501
Closed
JonathanBrouwer wants to merge 11 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>
…ng logic
When encountering a E0308 error involving `ty::Projection`s, highlight only the sub-parts that are actually relevant:
```
error[E0308]: mismatched types
--> tests/ui/associated-types/long-type-E0308.rs:19:5
|
16 | fn foo<'a, T: FooBar>(value: T) -> <<<T::Wrapper<T> as FooBar>::Assoc as FooBar>::Assoc as FooBar>::Wrapper<<T::Assoc as FooBar>::Assoc> {
| ----------------------------------------------------------------------------------------------------- expected `<<<... as FooBar>::Assoc as FooBar>::Assoc as FooBar>::Wrapper<...>` because of return type
...
19 | value.assoc().assoc().assoc().wrap(value.assoc().assoc())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `really_really_really_long_module::FooBar::Wrapper`, found `really_really_really_long_module::FooBar::Assoc`
|
= note: expected associated type `<<<<_ as FooBar>::Wrapper<T> as FooBar>::Assoc as FooBar>::Assoc as FooBar>::Wrapper<_>`
found associated type `<<<<_ as FooBar>::Assoc as FooBar>::Assoc as FooBar>::Assoc as FooBar>::Wrapper<_>`
= note: an associated type was expected, but a different one was found
= note: the full name for the type has been written to 'long-type-E0308.long-type-5396540309891820670.txt'
= note: consider using `--verbose` to print the full type name to the console
```
Deduplicate param highlighting logic.
Account for type param difference in trait in E0308 highlighting.
…e highlighted string instead
Introduce a mechanism to textually trim highlighted strings, so that we can print out "expected/found" note with shorter output while still keeping the highlighted inner parts.
```
error[E0308]: mismatched types
--> $DIR/long-type-E0308.rs:30:5
|
LL | ) -> <
| ______-
LL | | <
LL | | <T::Wrapper<T> as FooBar>::Assoc as FooBar
LL | | >::Assoc as FooBar
LL | | >::Wrapper<<T::Assoc as FooBar>::Assoc>
| |_______________________________________- expected `<_ as FooBar>::Wrapper<_>` because of return type
...
LL | value...oc())
| ^^^^^...^^^^^ expected `really_really_really_long_module::FooBar::Wrapper`, found `really_really_really_long_module::FooBar::Assoc`
|
= note: expected associated type `<<<<_ as FooBar>::Wrapper<_> as...pper<_>`
found associated type `<<<<_ as FooBar>::Assoc as Fo...pper<_>`
= note: an associated type was expected, but a different one was found
= note: the full name for the type has been written to '$TEST_BUILD_DIR/long-type-E0308.long-type-$LONG_TYPE_HASH.txt'
= note: consider using `--verbose` to print the full type name to the console
```
Account for type alias projections in E0308 "expected/found" shortening logic
When encountering a E0308 error involving `ty::Projection`s, highlight only the sub-parts that are actually relevant:
```
error[E0308]: mismatched types
--> tests/ui/associated-types/long-type-E0308.rs:19:5
|
16 | fn foo<'a, T: FooBar>(value: T) -> <<<T::Wrapper<T> as FooBar>::Assoc as FooBar>::Assoc as FooBar>::Wrapper<<T::Assoc as FooBar>::Assoc> {
| ----------------------------------------------------------------------------------------------------- expected `<<<... as FooBar>::Assoc as FooBar>::Assoc as FooBar>::Wrapper<...>` because of return type
...
19 | value.assoc().assoc().assoc().wrap(value.assoc().assoc())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `really_really_really_long_module::FooBar::Wrapper`, found `really_really_really_long_module::FooBar::Assoc`
|
= note: expected associated type `<<<<_ as FooBar>::Wrapper<T> as FooBar>::Assoc as FooBar>::Assoc as FooBar>::Wrapper<_>`
found associated type `<<<<_ as FooBar>::Assoc as FooBar>::Assoc as FooBar>::Assoc as FooBar>::Wrapper<_>`
= note: an associated type was expected, but a different one was found
= note: the full name for the type has been written to 'long-type-E0308.long-type-5396540309891820670.txt'
= note: consider using `--verbose` to print the full type name to the console
```
Fix rust-lang#159043, by including a textual type shortening logic that operates on the highlighted text on really narrow terminals:
```
error[E0308]: mismatched types
--> $DIR/long-type-E0308.rs:30:5
|
LL | ) -> <
| ______-
LL | | <
LL | | <T::Wrapper<T> as FooBar>::Assoc as FooBar
LL | | >::Assoc as FooBar
LL | | >::Wrapper<<T::Assoc as FooBar>::Assoc>
| |_______________________________________- expected `<_ as FooBar>::Wrapper<_>` because of return type
...
LL | value...oc())
| ^^^^^...^^^^^ expected `really_really_really_long_module::FooBar::Wrapper`, found `really_really_really_long_module::FooBar::Assoc`
|
= note: expected associated type `<<<<_ as FooBar>::Wrapper<_> as...pper<_>`
found associated type `<<<<_ as FooBar>::Assoc as Fo...pper<_>`
= note: an associated type was expected, but a different one was found
= note: the full name for the type has been written to '$TEST_BUILD_DIR/long-type-E0308.long-type-$LONG_TYPE_HASH.txt'
= note: consider using `--verbose` to print the full type name to the console
```
r? @chenyukang
…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: - #159189 (Account for type alias projections in E0308 "expected/found" shortening logic) - #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) |
Contributor
|
💔 Test for d1ac568 failed: CI. Failed job:
|
Contributor
|
PR #159189, which is a member of this rollup, was unapproved. |
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:
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