mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 19:58:32 +00:00
Auto merge of #38539 - jseyfried:fix_resolve_hang, r=eddyb
resolve: fix non-termination Fixes #34324. r? @eddyb
This commit is contained in:
commit
20b6c160ca
@ -2931,6 +2931,7 @@ impl<'a> Resolver<'a> {
|
|||||||
|
|
||||||
let mut lookup_results = Vec::new();
|
let mut lookup_results = Vec::new();
|
||||||
let mut worklist = Vec::new();
|
let mut worklist = Vec::new();
|
||||||
|
let mut seen_modules = FxHashSet();
|
||||||
worklist.push((self.graph_root, Vec::new(), false));
|
worklist.push((self.graph_root, Vec::new(), false));
|
||||||
|
|
||||||
while let Some((in_module,
|
while let Some((in_module,
|
||||||
@ -2976,7 +2977,7 @@ 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();
|
||||||
if !worklist.iter().any(|&(m, ..)| m.def() == module.def()) {
|
if seen_modules.insert(module.def_id().unwrap()) {
|
||||||
worklist.push((module, path_segments, is_extern));
|
worklist.push((module, path_segments, is_extern));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
// aux-build:recursive_reexports.rs
|
// aux-build:recursive_reexports.rs
|
||||||
|
|
||||||
fn f() -> recursive_reexports::S {} //~ ERROR undeclared
|
extern crate recursive_reexports;
|
||||||
|
|
||||||
|
fn f() -> recursive_reexports::S {} //~ ERROR type name `recursive_reexports::S` is undefined
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
Loading…
Reference in New Issue
Block a user