-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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? |
Moving |
I'll create a pr for it. |
…etrochenkov Test: Ambigious bindings in same namespace with the same res Add a test based on the discussion [here](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Parallel.20Macro.20Expansion/near/542316157) and related to rust-lang/rust#145575 (comment). This is the most reduced form I could create that passes on nightly but fails with rust-lang/rust#145108 (see [#gsoc > Project: Parallel Macro Expansion @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Parallel.20Macro.20Expansion/near/542335131)). Also not sure about the test names. r? `@petrochenkov`
3b3d0ed
to
be968c5
Compare
I rebased onto a more recent version of master just to make sure and found a way to fix #145108 (comment). Lets see |
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
Collect side effects from the current set of undetermined imports and only apply them at the end.
bless another test
be968c5
to
9e951c9
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. |
This comment has been minimized.
This comment has been minimized.
I can reproduce that locally, but when I remove that import, everything compiles just fine. I'm guessing this has nothing to do with this pr, so I'll just wait. |
@LorrensP-2158466 Could you send a PR with a fix to the |
If the import is legitimately unused, then it should be removed. |
Nice! I'll remove it. |
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
self.greatest_vis_map.get(&def_id).copied().unwrap_or(binding.vis); | ||
// macros exported through `macro_export` are not placed in this map, so | ||
// hack the hack and make sure we still keep the best visibility. | ||
if !vis.is_at_least(binding.vis, self.tcx()) { binding.vis } else { vis } |
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 hack has a chance to promote too many unrelated bindings to pub
.
Unrelated public item with the same DefId
in a different module? Promote to pub
.
The glob import never shadows any #[macro_rules]
and is never reexported? Nevermind, still promote to pub
.
When clicking on the "repository" link in the crates-io page, I get "404 not found", link: Searching for it in "sourcehut" also doesn't work: https://sr.ht/projects?search=rust-embed&sort=longest-active. I also can't find it on GitHub and GitLab |
This is blocked on me doing some work, rather than reviewing (reexporting ambiguities to other crates, removing mutability from extern underscore disambiguators, finding better solution for the |
https://pyrossh.dev has the author's email. |
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