Fix large_futures ICE with the next solver - #17601
Conversation
With the new trait solver enabled by default in nightly-2026-08-22 [1], large_futures can ICE while inspecting an awaited future. The lint switches to Codegen mode to obtain coroutine layouts but passes a type whose opaque aliases are still marked rigid from type checking. Because layout_of receives an already-Codegen environment, its environment-change path does not clear those markers. Clear alias rigidity and normalize the awaited type in that environment before querying its layout. Codegen mode must remain: post-analysis layout queries cannot compute coroutine sizes [2]. The regression covers direct and pinned futures under both solvers, without other lint errors that could hide a delayed ICE. Fixes rust-lang/rust#161495. [1]: rust-lang/rust#160619 [2]: rust-lang/rust#145477
|
Thanks for the pull request. A reviewer will take a look after it receives 2 community reviews. In the meantime, we would highly appreciate if you could try to review any of PRs waiting on community reviews. |
|
|
Error: Failed to set assignee to
Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
There was a problem hiding this comment.
community review:
not entirely sure I follow why ty::set_aliases_to_non_rigid (that would require a bit of deeper context that @jdonszelmann is likely better to judge 😅), but explanation and testcase sounds plausible to me.
The rigidity marker is specific to the environment where the alias was normalized. We switch to
|
|
Ah, makes sense. |
|
|
I checked that path: its local The existing CI is green. If you're happy with the current patch, could you submit an approving GitHub review? CommanderStorm has approved; Clippy needs two community approvals before assigning a maintainer. |
|
r? @dswij rustbot has assigned @dswij for the project review. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Every nightly from 2026-08-22 onward ICEs on this job with `unexpected rigid alias in layout_of after normalization`, on the opaque returned by `bare_metal_tasks::run_someip`. `main` has been red since 08-22 with no code change. The trigger is `clippy::pedantic` enabling `large_futures`, which switches to Codegen mode to read a coroutine layout while the opaque aliases are still marked rigid from type checking. Confirmed as a toolchain bug, not ours: plain `cargo check` on the same nightly is clean, only `cargo clippy` fails, and it reproduces on unmodified `main`. Bisected to the nightly-2026-08-21 → nightly-2026-08-22 window. rust-lang/rust-clippy#17601 fixed it on 2026-08-23, but the fix has to ride a clippy subtree sync into rustc before any nightly carries it, so the lane stays red until then. Pinning to the last known-good nightly rather than allowing the lint keeps `large_futures` running — it is worth more here than anywhere else in the tree, since a fat future on the bare-metal runtime is a static pool sized to hold it. All four steps of the job pass on the pinned toolchain. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

With the new trait solver enabled by default in nightly-2026-08-22 1, large_futures can ICE while inspecting an awaited future.
The lint switches to Codegen mode to obtain coroutine layouts but passes a type whose opaque aliases are still marked rigid from type checking. Because layout_of receives an already-Codegen environment, its environment-change path does not clear those markers.
Clear alias rigidity and normalize the awaited type in that environment before querying its layout. Codegen mode must remain: post-analysis layout queries cannot compute coroutine sizes 2.
The regression covers direct and pinned futures under both solvers, without other lint errors that could hide a delayed ICE.
Fixes rust-lang/rust#161495.
changelog: [
large_futures]: Fix an ICE on awaited futures with the next trait solver.