Rollup of 23 pull requests#158316
Closed
JonathanBrouwer wants to merge 65 commits into
Closed
Conversation
This is a follow-up to rust-lang#155431
When an index expression with an ambiguous type (e.g. `arr[idx.into()]`) appears inside a cast or binary operation, the type inference error was incorrectly attributed to the outer expression instead of the `.into()` call. Resolve the index sub-expression type first so the error points at the actual ambiguous site.
The region-constraint machinery for `-Zassumptions-on-binders` is region-outlives-only. A non-lifetime binder (`for<T>`) introduces a placeholder type in the binder's universe `u`. The rewrite that pulls constraints out of `u` only folds regions (`PlaceholderReplacer` just implements `fold_region`), so an alias-outlives constraint such as `<!T as Trait>::Assoc: 'r` reaches `pull_region_outlives_constraints_out_of_universe` still in `u` and trips `assert!(max_universe < u)`. Report ambiguity for those constraints instead of asserting, matching the existing `None => Ambiguity` bail-outs in this module. The goal then surfaces as an ordinary ambiguity error rather than an ICE.
The `MaxUniverse` region visitor matched on `ReVar` terms and unwrapped `universe_of_lt`, which returns `None` for a variable that has already been unified with another region. Such resolved variables can reach the visitor while computing region assumptions under `-Zassumptions-on-binders`, causing an ICE. Resolve the variable first and inspect whatever it points at instead of assuming it is still an unresolved inference variable.
Adjust ambiguous index diagnostics without adding new index operand resolution points. Keep invalid operator and mismatched operand diagnostics on the operator while still pointing valid ambiguous index cases at the index operand.
…er expected enum diagnostics
…xternal `module` variants.
They tend to have similar handling -- e.g., they should be the only input to the `mir_shims` query -- so it's cleaner to group them together. This will also make potential future refactorings easier, such as only carrying `GenericArgsRef` for instances that actually use it (e.g., `Item`) but not others (e.g., `CloneShim`). Many of the shim variants still have `Shim` at the end of their names. To make the refactoring easier and keep the diff clean, I will trim those suffixes off in the next commit.
Contributor
Author
Contributor
Contributor
|
⌛ Trying commit 04e4c9b with merge 89c2b53… To cancel the try build, run the command Workflow: https://github.com/rust-lang/rust/actions/runs/28045422763 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 23, 2026
Rollup of 23 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-2
Contributor
Author
Contributor
|
Try build cancelled. Cancelled workflows: |
Contributor
|
⌛ Trying commit 04e4c9b with merge 0b522ab… To cancel the try build, run the command Workflow: https://github.com/rust-lang/rust/actions/runs/28045473236 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 23, 2026
Rollup of 23 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-2 try-job: dist-i686-msvc
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
PR #158168, which is a member of this rollup, was unapproved. This rollup was thus unapproved. |
Contributor
Author
|
@bors try cancel |
Contributor
|
Try build cancelled. Cancelled workflows: |
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:
set_permissions_nofollowfor all primary platforms #158168 (Added implementation onset_permissions_nofollowfor all primary platforms)proc_macrothings #157271 (simplify someproc_macrothings)extern "tail"#157983 (Lift the same-signature restriction forextern "tail")ShimKindenum #158105 (Extract all instance shim variants into newShimKindenum)resolve_ident_in_module_non_globs_unadjusted#158207 (Resolver: local/external split ofresolve_ident_in_module_non_globs_unadjusted)-Zassumptions-on-binders#157807 (don't ice on non-lifetime binders under-Zassumptions-on-binders)cfg_selectinstd::os#158252 (Usecfg_selectinstd::os)Failed merges:
r? @ghost
Create a similar rollup