From 2890a1450ad4aa54362c6783c790422db193108c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 17 Sep 2019 21:04:15 +0300 Subject: remove confusing code I must confess I don't really understand what this code is trying to do, but it definitely misreports changes during fixedpoint iteration, and no tests fail if I remove it, so... --- crates/ra_hir/src/nameres/collector.rs | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'crates') diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs index 1446c49a0..a6b9b41d0 100644 --- a/crates/ra_hir/src/nameres/collector.rs +++ b/crates/ra_hir/src/nameres/collector.rs @@ -114,7 +114,7 @@ where _ => i += 1, } if i == 1000 { - log::error!("diverging name resolution"); + log::error!("name resolution is stuck"); break; } } @@ -444,36 +444,6 @@ where return false; } - if resolved_res.reached_fixedpoint != ReachedFixedPoint::Yes { - let crate_name = &path.segments[0].name; - - // FIXME: - // $crate are not handled in resolver right now - if crate_name.to_string() == "$crate" { - return true; - } - - // FIXME: - // Currently `#[cfg(test)]` are ignored and cargo-metadata do not insert - // dev-dependencies of dependencies. For example, - // if we depend on parking lot, and parking lot has a dev-dependency on lazy_static. - // Then `lazy_static` wil not included in `CrateGraph` - // We can fix that by proper handling `cfg(test)`. - // - // So right now we set the fixpoint to No only if its crate is in CrateGraph - // See issue #1282 for details - let krate = - match self.def_map.resolve_name_in_extern_prelude(crate_name).take_types() { - Some(ModuleDef::Module(m)) => m.krate(self.db), - _ => return true, - }; - if krate.is_none() { - return true; - } - - res = resolved_res.reached_fixedpoint; - } - true }); -- cgit v1.2.3