Rollup of 16 pull requests#158301
Open
JonathanBrouwer wants to merge 50 commits into
Open
Conversation
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.
It used to be much more prevalent before I extracted shims as their own enum.
…, r=petrochenkov Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` This PR splits the function `resolve_ident_in_module_non_globs_unadjusted` into 2 variants: - one for local modules, which is the same work as before - other for external modules, which requires less work In preperations for parallel import resolution and overall resolver refactor. r? @petrochenkov
…rtdev Follow goto and drop when linting unreachable code Those drops and gotos are compiler-generated and do not correspond to user code. Skip them when looking for unreachable code to lint.
…_non_lifetime_binder_ambiguity, r=BoxyUwU don't ice on non-lifetime binders under `-Zassumptions-on-binders` fixes rust-lang#157778 w/ `-Znext-solver=globally -Zassumptions-on-binders` and a non-lifetime binder we hit `assert!(max_universe < u)` in `pull_region_outlives_constraints_out_of_universe` and ICE. the machinery here is region-outlives only, but a `for<T>` binder leaves a placeholder type in universe `u` that the region-only rewrite can't pull out, so an alias outlives like `<!T as Trait>::Assoc: 'r` reaches that assert still in `u`. just report ambiguity in that case, same as the `None => Ambiguity` bails right next to it — now it errors normally (E0284) instead of ICEing. r? @lcnr
Update mingw-w64 C toolchain
…_diagnostic, r=TaKO8Ki format: ignore println newline in foreign format hints fixes rust-lang#158216 `println!` adds a newline before the unused-arg diagnostic checks for printf-style formats. that made a trailing `%` look like `%` plus ` `, so rustc printed a weird unsupported conversion specifier note. imo the least risky fix is to leave normal format parsing alone and only strip that synthetic newline for the foreign-format hint scan. idk if there is much more to do here, the ui tests cover the reported case plus the older trailing-percent baselines. lgtm to me, ltm this keeps the behavior narrow.
Move target checking for #[lang] to the attribute parser Work towards removing the `ALL_TARGETS` list. r? @mejrs
Use `cfg_select` in `std::os` rust-lang#81969 replaced `cgf_if` with bare `cfg`, but since `cfg_select` is now built in, it shouldn't pose a problem to rust-analyzer any more, so we should be able to go back to better code.
…white fix escaping placeholder check in next solver normalization folder r? @BoxyUwU @adwinwhite
…-light-chevrolet-my-mama-taught-me-wrong-from-right, r=jieyouxu triagebot: Stop pinging myself rust-lang/team#2523
… r=tgross35,jhpratt slice_split_once: bounds check optimization note Tracking issue: rust-lang#112811 ~~Use unchecked sub-slicing operations for `<T>::split_once` and `<T>::rsplit_once`.~~ Note that unchecked sub-slicing operations are equivalent to the current checked sub-slicing operations.
Contributor
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 23, 2026
Rollup of 16 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
|
⌛ Testing commit 3ef0f8c with merge 54f7041... Workflow: https://github.com/rust-lang/rust/actions/runs/28024825832 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 23, 2026
…uwer Rollup of 16 pull requests Successful merges: - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #158020 (Update mingw-w64 C toolchain) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158257 ( fix escaping placeholder check in next solver normalization folder) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) Failed merges: - #158256 (Avoid parser panics bubbling out to proc macros)
Contributor
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:
proc_macrothings #157271 (simplify someproc_macrothings)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