Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a fresh InferCtxt when we 'speculatively' evaluate predicates #91183

Closed
wants to merge 2 commits into from

Commits on Nov 26, 2021

  1. Use a fresh InferCtxt when we 'speculatively' evaluate predicates

    The existing `InferCtxt` may already have in-progress projections
    for some of the predicates we may (recursively evaluate). This can
    cause us to incorrect produce (and cache!) `EvaluatedToRecur`, leading
    us to incorrectly mark a predicate as unimplemented.
    
    We now create a fresh `InferCtxt` for each sub-obligation that we
    'speculatively' evaluate. This causes us to miss out on some
    legitimate caching opportunities, but ensures that our speculative
    evaluation cannot pollute any of the caches from the 'real' `InferCtxt`.
    The evaluation can still update *global* caches, but our global caches
    don't have any notion of 'in progress', so this is fine.
    
    Fixes rust-lang#90662
    Aaron1011 committed Nov 26, 2021
    Configuration menu
    Copy the full SHA
    04964d7 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2021

  1. Re-use the fresh InferCtxt

    Aaron1011 committed Nov 27, 2021
    Configuration menu
    Copy the full SHA
    931a3a6 View commit details
    Browse the repository at this point in the history