Skip to content

Commit 232783c

Browse files
committed
Fix infinite loop on recursive module exports in an extern crate
1 parent ea0dc92 commit 232783c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_resolve/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3194,7 +3194,9 @@ impl<'a> Resolver<'a> {
31943194
if !in_module_is_extern || name_binding.vis == ty::Visibility::Public {
31953195
// add the module to the lookup
31963196
let is_extern = in_module_is_extern || name_binding.is_extern_crate();
3197-
worklist.push((module, path_segments, is_extern));
3197+
if !worklist.iter().any(|&(m, _, _)| m.def == module.def) {
3198+
worklist.push((module, path_segments, is_extern));
3199+
}
31983200
}
31993201
}
32003202
})

0 commit comments

Comments
 (0)