Skip to content

Commit f99cdf8

Browse files
committed
explain ImportData::imported_module
1 parent b63223c commit f99cdf8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/rustc_resolve/src/imports.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,14 @@ 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+
///
179+
/// | `module_path` | `imported_module` | remark |
180+
/// |-|-|-|
181+
/// |`use prefix::foo`| `ModuleOrUniformRoot::Module(prefix)` | - |
182+
/// |`use ::foo` | `ModuleOrUniformRoot::ExternPrelude` | 2018+ editions |
183+
/// |`use ::foo` | `ModuleOrUniformRoot::CrateRootAndExternPrelude` | a special case in 2015 edition |
184+
/// |`use foo` | `ModuleOrUniformRoot::CurrentScope` | - |
178185
pub imported_module: Cell<Option<ModuleOrUniformRoot<'ra>>>,
179186
pub vis: ty::Visibility,
180187
}

0 commit comments

Comments
 (0)