Skip to content

Rollup of 16 pull requests#158301

Open
JonathanBrouwer wants to merge 50 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-vdhGhPp
Open

Rollup of 16 pull requests#158301
JonathanBrouwer wants to merge 50 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-vdhGhPp

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

Failed merges:

r? @ghost

Create a similar rollup

Dnreikronos and others added 30 commits May 24, 2026 14:22
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.
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
…_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.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 23, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jun 23, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1,i686-msvc-2

@rust-bors

rust-bors Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3ef0f8c has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 23, 2026
@rust-bors

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
@rust-bors

rust-bors Bot commented Jun 23, 2026

Copy link
Copy Markdown
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)
@rust-bors

rust-bors Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 323375e (323375e49495adbf90d0ed1587c5355e27397041)
Base parent: 4429659 (4429659e4745016bd3f26a4a421843edc7fbc422)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.