Skip to content

Implement expand_glob_reexport assist #19158

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

Merged
merged 3 commits into from
Feb 17, 2025

Conversation

PoignardAzur
Copy link
Contributor

Fixes #13511 .

The code ends up pretty messy. To handle this more cleanly, I'd want some equivalent of hir_def::visibility::Visibility::is_visible_from that takes a syntax::ast::Visibility as the origin, or at least some type that can be easily derived from syntax::ast::Visibility.

The general problem (from my naive viewpoint as someone unfamiliar with the codebase) is that as far as I can tell the HIR data types you can get from ctx.sema already lost all knowledge about use xxx items; and those data types are the ones that can do fancy visibility computation. (hir_def::item_tree::Use would be useful, but I haven't found a way to get one from a syntax::ast::Use)

Anyway, 99% of re-exports are pub or pub(crate) anyway, so this should already be a large improvement.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 15, 2025
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril Veykril added this pull request to the merge queue Feb 17, 2025
Merged via the queue into rust-lang:master with commit a3f937f Feb 17, 2025
9 checks passed
@PoignardAzur
Copy link
Contributor Author

Well that was fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expand glob import should expand to all possible items without filtering for pub use reexports.
3 participants