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:
|

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.