Skip to content

explain ImportData::imported_module #143063

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bvanjoi
Copy link
Contributor

@bvanjoi bvanjoi commented Jun 26, 2025

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 26, 2025
/// The resolution of `module_path`.
/// The resolution of `module_path`:
/// - It refers to `a::b` when the `module_path` is `a::b::c`.
/// - It refers to the module where the use statement is
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case it doesn't refer to a module, but to the current scope (ModuleOrUniformRoot::CurrentScope).

In fact, imported_module can refer to all variants of ModuleOrUniformRoot, including ModuleOrUniformRoot::ExternPrelude and ModuleOrUniformRoot::CrateRootAndExternPrelude for imports like use ::foo; on 2018+ editions.

Side note: the naming ModuleOrUniformRoot is very outdated, but I'm not sure how to call this thing properly.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
3 participants