Skip next-solver fulfillment when no type var was instantiated - #161480
Closed
anonrig wants to merge 1 commit into
Closed
Skip next-solver fulfillment when no type var was instantiated#161480anonrig wants to merge 1 commit into
anonrig wants to merge 1 commit into
Conversation
Collaborator
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
Collaborator
|
Thanks for the pull request, and welcome! The Rust Project has assigned @lcnr (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions for more information. |
Unknown-unknown equate and sub-unify do not make single-var stalled goals progress. Track instantiations in the infer undo log and skip the pending-queue walk when every pending goal is type-var-only with at most one stalled vid. This removes the remaining quadratic rescan on rustc#159933: each `push(Default::default())` equates a fresh vid with the vec element vid, so goals stay stalled until a later instantiate. Two-var goals still take the existing path.
anonrig
force-pushed
the
next-solver-skip-fulfill-without-instantiate
branch
from
August 21, 2026 18:26
30aaa49 to
6b7c35a
Compare
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.
Refs #159933
r? lcnr
Next-solver fulfillment walks the pending queue on every
try_evaluate_obligations. On #159933 (v.push(Default::default())thenv.push(0u8)), each push equates a fresh infer vid with the vec element vid. Those equates are unknown-unknown:ty_or_const_infer_var_changedstays false until a vid is instantiated, butsub_rootsgo stale and force a full rescan.This records instantiations in the infer undo log and skips the
retain_mutwalk when:Two-var goals (for example
Mirrorwith distinct self and parameter infer vars that later unify) still take the existing path.-Zdisable-fast-pathsdisables the skip.