Rollup of 9 pull requests#154062
Closed
JonathanBrouwer wants to merge 22 commits intorust-lang:mainfrom
Closed
Conversation
`-Zunpretty=expanded,hygiene` was not printing syntax context annotations for identifiers and lifetimes inside `macro_rules!` bodies. These tokens are printed via `print_tt()` → `token_to_string_ext()`, which converts tokens to strings without calling `ann_post()`. This meant that macro-generated `macro_rules!` definitions with hygienic metavar parameters (e.g. multiple `$marg` distinguished only by hygiene) were printed with no way to tell them apart. This was fixed by adding a match on `token.kind` in `print_tt()` to call `ann_post()` for `Ident`, `NtIdent`, `Lifetime`, and `NtLifetime` tokens, matching how `print_ident()` and `print_lifetime()` already handle AST-level identifiers and lifetimes. Signed-off-by: Andrew V. Teylu <andrew.teylu@vector.com>
Add `unpretty-debug-shadow` test covering macro body tokens that reference a shadowed variable, and simplify the `unpretty-debug-metavars` test macro. Signed-off-by: Andrew V. Teylu <andrew.teylu@vector.com>
Co-authored-by: BoxyUwU <rust@boxyuwu.dev>
* add bootstrap for stdarch-verify * update bootstrap snapshot * make default * update snapshots
When encountering an inference error where a return type must be known, like when calling `Iterator::sum::<T>()` without specifying `T`, look for all `T` that would satisfy `Sum<S>`. If only one, suggest it. ``` error[E0283]: type annotations needed --> $DIR/cannot-infer-iterator-sum-return-type.rs:4:9 | LL | let sum = v | ^^^ ... LL | .sum(); // `sum::<T>` needs `T` to be specified | --- type must be known at this point | = note: cannot satisfy `_: Sum<i32>` help: the trait `Sum` is implemented for `i32` --> $SRC_DIR/core/src/iter/traits/accum.rs:LL:COL ::: $SRC_DIR/core/src/iter/traits/accum.rs:LL:COL | = note: in this macro invocation note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL = note: this error originates in the macro `integer_sum_product` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider giving `sum` an explicit type, where the type for type parameter `S` is specified | LL | let sum: i32 = v | +++++ ```
Add bootstrap step for stdarch-verify
This PR hooks `library/stdarch/crates/stdarch-verify` crate into the bootstrap test runner as a step, so that we can run the stdarch-verify suite via x.py test.
Changes :
-> Added StdarchVerify in `src/bootstrap/src/core/build_steps/test.rs`
-> Added `test::StdarchVerify` in `src/bootstrap/src/core/builder/mod.rs`
Tests:
-> Running `./x.py test library/stdarch/crates/stdarch-verify` builds compiler and std successfully.
-> All three integration tests Passes:
tests/arm.rs
tests/mips.rs
tests/x86-intel.rs
-> Doc tests for `stdarch_verify` also Passes.
r? @Kobzol
When single impl can satisfy inference error, suggest type When encountering an inference error where a return type must be known, like when calling `Iterator::sum::<T>()` without specifying `T`, look for all `T` that would satisfy `Sum<S>`. If only one, suggest it. ``` error[E0283]: type annotations needed --> $DIR/cannot-infer-iterator-sum-return-type.rs:4:9 | LL | let sum = v | ^^^ ... LL | .sum(); // `sum::<T>` needs `T` to be specified | --- type must be known at this point | = note: cannot satisfy `_: Sum<i32>` help: the trait `Sum` is implemented for `i32` --> $SRC_DIR/core/src/iter/traits/accum.rs:LL:COL ::: $SRC_DIR/core/src/iter/traits/accum.rs:LL:COL | = note: in this macro invocation note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL = note: this error originates in the macro `integer_sum_product` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider giving `sum` an explicit type, where the type for type parameter `S` is specified | LL | let sum: i32 = v | +++++ ``` Fix rust-lang#100802.
…elmann Add hygiene annotations for tokens in `macro_rules!` bodies `-Zunpretty=expanded,hygiene` was not printing syntax context annotations for identifiers and lifetimes inside `macro_rules!` bodies. These tokens are printed via `print_tt()` → `token_to_string_ext()`, which converts tokens to strings without calling `ann_post()`. This meant that macro-generated `macro_rules!` definitions with hygienic metavar parameters (e.g. multiple `$marg` distinguished only by hygiene) were printed with no way to tell them apart. This was fixed by adding a match on `token.kind` in `print_tt()` to call `ann_post()` for `Ident`, `NtIdent`, `Lifetime`, and `NtLifetime` tokens, matching how `print_ident()` and `print_lifetime()` already handle AST-level identifiers and lifetimes.
fix inference variables leaking into HIR const literal lowering logic Inference variables could leak into further const lowering logic It ICEs when query system tries to cache `lit_to_const()` after its execution and panics, because inference variables are not hashable for some reason Fixes rust-lang#153524 Fixes rust-lang#153525
Fix some suggestions of the `for-loops-over-fallibles` lint Fix rust-lang#148114 Fix rust-lang#147973 Also address rust-lang/rust-clippy#16133 which is another case of it
mGCA: Lower const generic args to infer when needed close: rust-lang#153198 r? BoxyUwU
… r=jieyouxu,kobzol bootstrap: Optionally print a backtrace if a command fails I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
… r=nnethercote borrowck/type_check: remove helper left-over from unsized locals This used to check two features, but ever since rust-lang#141811 it's only one so there's no reason any more to have a helper function here.
merge `regions-outlives-nominal-type-*` tests into one file This is easily done since each of the individual files was already wrapped in a `mod`. Also, this removes the unneeded `rustc_attrs` usage from the tests.
Contributor
Author
|
@bors r+ rollup=never p=5 |
Contributor
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 19, 2026
Rollup of 9 pull requests try-job: aarch64-msvc-1
This comment has been minimized.
This comment has been minimized.
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 19, 2026
…uwer Rollup of 9 pull requests Successful merges: - #153957 (Add bootstrap step for stdarch-verify) - #153727 (When single impl can satisfy inference error, suggest type) - #153308 (Add hygiene annotations for tokens in `macro_rules!` bodies) - #153557 (fix inference variables leaking into HIR const literal lowering logic) - #153913 (Fix some suggestions of the `for-loops-over-fallibles` lint) - #153987 (mGCA: Lower const generic args to infer when needed) - #153992 (bootstrap: Optionally print a backtrace if a command fails) - #154036 (borrowck/type_check: remove helper left-over from unsized locals) - #154038 (merge `regions-outlives-nominal-type-*` tests into one file)
Contributor
Contributor
|
💔 Test for be69110 failed: CI. Failed job:
|
Contributor
Author
|
... probably spurious? |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
Author
|
@bors try jobs=x86_64-gnu-distcheck |
This comment has been minimized.
This comment has been minimized.
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 19, 2026
Rollup of 9 pull requests try-job: x86_64-gnu-distcheck
Contributor
|
⌛ Testing commit 3f102c1 with merge 2785251... Workflow: https://github.com/rust-lang/rust/actions/runs/23291278868 |
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 19, 2026
…uwer Rollup of 9 pull requests Successful merges: - #153957 (Add bootstrap step for stdarch-verify) - #153727 (When single impl can satisfy inference error, suggest type) - #153308 (Add hygiene annotations for tokens in `macro_rules!` bodies) - #153557 (fix inference variables leaking into HIR const literal lowering logic) - #153913 (Fix some suggestions of the `for-loops-over-fallibles` lint) - #153987 (mGCA: Lower const generic args to infer when needed) - #153992 (bootstrap: Optionally print a backtrace if a command fails) - #154036 (borrowck/type_check: remove helper left-over from unsized locals) - #154038 (merge `regions-outlives-nominal-type-*` tests into one file)
Contributor
|
💔 Test for 979f173 failed: CI. Failed job:
|
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
Author
Contributor
|
This pull request was unapproved. Auto build was cancelled due to unapproval. Cancelled workflows: |
Contributor
|
❗ There is currently no auto build in progress on this PR. |
Contributor
|
PR #153992, which is a member of this rollup, was unapproved. |
Contributor
Author
|
This is #153992 |
This was referenced Mar 19, 2026
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.
View all comments
Successful merges:
macro_rules!bodies #153308 (Add hygiene annotations for tokens inmacro_rules!bodies)for-loops-over-fallibleslint #153913 (Fix some suggestions of thefor-loops-over-fallibleslint)regions-outlives-nominal-type-*tests into one file #154038 (mergeregions-outlives-nominal-type-*tests into one file)r? @ghost
Create a similar rollup