-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: Implement fallback properly #20721
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
Conversation
|
||
ctx.infer_mut_body(); | ||
|
||
ctx.infer_closures(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closure analysis should be done after fallback.
025c4d8
to
69544c0
Compare
self.table.fallback_if_possible(); | ||
/// Clones `self` and calls `resolve_all()` on it. | ||
// FIXME: Remove this. | ||
pub(crate) fn fixme_resolve_all_clone(&self) -> InferenceResult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that this clone and resolve all pattern already exists in our consteval modules.
Is this function being introduced to group necessary calls together that should be called in order to handle fallbacks correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not introduce new usages of the pattern. I created the function since I was changing the ordering of things we do on finish, and this pattern requires running only some passes. I also took the chance to give it a scary name 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall, though this has small conflict with master
(Maybe #20717? 😅 )
fallback.rs was ported straight from rustc (minus the lint parts). This fixes the `!` regressions.
69544c0
to
6b133c6
Compare
What broke CI? |
It's passing now 🤷 Anyway, merging based on approval above. |
fallback.rs was ported straight from rustc (minus the lint parts).
This fixes the
!
regressions.rustc uses graphs from rustc-data-structures. I opted to depend on an external dependency (
petgraph
), since implementing graph handling ourselves doesn't seem like a good idea.