-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Inline evaluate_obligation
instead of going through the query system
#81150
Conversation
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
There are several reasons I changed this: - `evaluate_obligation` is only used in one place in `rustc_trait_selection`, and in fact warns you against using it anywhere else. - The implementation in `rustc_traits` was considerably more complicated than necessary, because it didn't have the context available in `rustc_trait_selection`. - It allows moving OverflowError into rustc_trait_selection, making rust-lang#81091 simpler (in particular, it allows holding an `Obligation` in OverflowError, which is only defined in `rustc_infer` and not available in rustc_middle). The only reason to keep the previous behavior is if the cache from the query system made it significantly faster.
8d69194
to
1548e0f
Compare
Hmm, I'm not sure why removing caching causes this test to fail:
rust/src/test/ui/traits/cycle-cache-err-60010.rs Lines 67 to 70 in 4253153
|
The job Click to see the possible cause of the failure (guessed by this bot)
|
I suspect that the test failure us due to the removed query canonicalization. |
Yup, I changed it to have the old code and the test passes now. I'm still confused why the cycle test is now failing, though. |
The job Click to see the possible cause of the failure (guessed by this bot)
|
i would expect that caching this query is quite useful, so I am hesitant on landing this. Once CI passes I would start by running perf |
☔ The latest upstream changes (presumably #81660) made this pull request unmergeable. Please resolve the merge conflicts. |
I don't know how to fix the test suite and it sounds like this won't be very useful. |
There are several reasons I changed this:
evaluate_obligation
is only used in one place inrustc_trait_selection
, and in fact warns you against using itanywhere else.
The implementation in
I think I just didn't understand how it worked.rustc_traits
was considerably more complicatedthan necessary, because it didn't have the context available in
rustc_trait_selection
.Move reporting recursion limit errors outside of the trait system #81091 simpler (in particular,
it allows holding an
Obligation
in OverflowError, which is onlydefined in
rustc_infer
and not available in rustc_middle).The only reason to keep the previous behavior is if the cache from the
query system made it significantly faster.