Skip to content

Commit 40305b2

Browse files
committed
explain ImportData::imported_module
1 parent 3b9d04c commit 40305b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_resolve/src/imports.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ pub(crate) struct ImportData<'ra> {
174174

175175
pub parent_scope: ParentScope<'ra>,
176176
pub module_path: Vec<Segment>,
177-
/// The resolution of `module_path`.
177+
/// The resolution of `module_path`:
178+
/// - It refers to `a::b` when the `module_path` is `a::b::c`.
179+
/// - It refers to the module where the use statement is
180+
/// defined when the `module_path` only has one segment.
178181
pub imported_module: Cell<Option<ModuleOrUniformRoot<'ra>>>,
179182
pub vis: ty::Visibility,
180183
}

0 commit comments

Comments
 (0)