resolve: Extend ambiguous_import_visibilities deprecation lint to glob-vs-glob ambiguities#154149
resolve: Extend ambiguous_import_visibilities deprecation lint to glob-vs-glob ambiguities#154149petrochenkov wants to merge 2 commits intorust-lang:mainfrom
ambiguous_import_visibilities deprecation lint to glob-vs-glob ambiguities#154149Conversation
| && let ItemKind::Use(_, UseKind::Glob) = item.kind | ||
| { | ||
| // Glob import visibilities can be increasee by other | ||
| // more public glob imports in cases of ambiguity. |
| tcx, | ||
| ); | ||
| if let Some(max_vis_decl) = decl.ambiguity_vis_max.get() { | ||
| // Avoid the most visible import in an ambiguous glob set being reported as unused. |
|
|
||
| if let Some(binding) = resolution.binding() | ||
| && old_decl != Some(binding) | ||
| && (old_decl != Some(binding) || old_vis != Some(binding.vis())) |
There was a problem hiding this comment.
And this is a fix for #152347.
Here we are triggering the glob re-fetching on visibility updates.
…lob-vs-glob ambiguities
171ed29 to
8c30e81
Compare
|
This PR was rebased onto a different main 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. |
|
@bors try |
This comment has been minimized.
This comment has been minimized.
resolve: Extend `ambiguous_import_visibilities` deprecation lint to glob-vs-glob ambiguities
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
Continuation of #149596, implementation of this comment #149596 (comment) in particular.
FCP for the lint in general - #149596 (comment).
#152498 is reverted as a part of the change, but fixes are applied to keep the tests added in that PR working.
To implement this we have to have to track the most and the least visible declarations in an ambiguous glob set.
Part of #153961.
r? @yaahc maybe