-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Resolver: Batched Import Resolution #145108
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
base: master
Are you sure you want to change the base?
Resolver: Batched Import Resolution #145108
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Code looks a little better now and should be more correct than the previous commits, but I have yet to find a way to resolve the current test failures. |
This comment has been minimized.
This comment has been minimized.
Okey, I did fix |
a3f8ae2
to
4a2a0dc
Compare
This comment has been minimized.
This comment has been minimized.
Could you update the tests to make CI green, so I can see the difference? |
tests/ui/imports/ambiguous-9.rs
Outdated
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.
This one is definitely wrong.
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.
This one is wrong as well.
Moving |
I'll create a pr for it. |
Maybe the commit loop will have to be split into two loops, the first one just setting |
This comment was marked as resolved.
This comment was marked as resolved.
I do not entirely agree with this. The errors started happening when we began using Reverting those changes did not resolve some of the errors; it even introduced new ones.
I've not been successful with this, but I should be getting close.
Thought of that as well, and this produces other errors. I've also noticed that meddling with the commit order produces a lot of different errors that make no more sense than the current ones. The most successful I've been in producing as few errors as possible is by first committing the glob side effects and then the single import side effects. The only errors that stay present are resolutions made of |
Currently doing this. |
fn resolve_import<'r>(mut self: CmResolver<'r, 'ra, 'tcx>, import: Import<'ra>) -> usize { | ||
/// Meanwhile, if resolution is successful, the side effect of the resolution is returned. | ||
fn resolve_import<'r>( | ||
self: &mut CmResolver<'r, 'ra, 'tcx>, |
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.
self: &mut CmResolver<'r, 'ra, 'tcx>, | |
&self, |
@@ -1484,66 +1583,47 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { | |||
false | |||
} | |||
|
|||
fn resolve_glob_import(&mut self, import: Import<'ra>) { | |||
fn resolve_glob_import<'r>( | |||
self: &mut CmResolver<'r, 'ra, 'tcx>, |
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.
self: &mut CmResolver<'r, 'ra, 'tcx>, | |
&self, |
3b2e50e
to
4efdee8
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Original resolver errors are resolved, but... |
Transforms the current algorithm for resolving imports to a batched algorithm. Every import in the
indeterminate_imports
set is resolved in isolation. This is the only real difference from the current algorithm.r? petrochenkov