Fix infinite loop on recursive module exports in an extern crate

This commit is contained in:
Jeffrey Seyfried 2016-06-28 23:03:56 +00:00
parent ea0dc92972
commit 232783c914

View File

@ -3194,7 +3194,9 @@ impl<'a> Resolver<'a> {
if !in_module_is_extern || name_binding.vis == ty::Visibility::Public { if !in_module_is_extern || name_binding.vis == ty::Visibility::Public {
// add the module to the lookup // add the module to the lookup
let is_extern = in_module_is_extern || name_binding.is_extern_crate(); let is_extern = in_module_is_extern || name_binding.is_extern_crate();
worklist.push((module, path_segments, is_extern)); if !worklist.iter().any(|&(m, _, _)| m.def == module.def) {
worklist.push((module, path_segments, is_extern));
}
} }
} }
}) })