Skip to content

Commit 3ee74ae

Browse files
committed
resolve: Never lookup glob names in modules from other crates
1 parent fda6d37 commit 3ee74ae

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

compiler/rustc_resolve/src/ident.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
638638
Err(ControlFlow::Break(..)) => return decl,
639639
}
640640
}
641+
Scope::ModuleGlobs(module, _)
642+
if let ModuleKind::Def(_, def_id, _) = module.kind
643+
&& !def_id.is_local() =>
644+
{
645+
// Fast path: external module decoding only creates non-glob declarations.
646+
Err(Determined)
647+
}
641648
Scope::ModuleGlobs(module, derive_fallback_lint_id) => {
642649
let (adjusted_parent_scope, adjusted_finalize) = if matches!(
643650
scope_set,

0 commit comments

Comments
 (0)