aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-09-17 19:06:06 +0100
committerGitHub <[email protected]>2019-09-17 19:06:06 +0100
commitd505ee968b2a99eed65dfe7be27940ad9b2647c1 (patch)
tree40d561575c5375543270029ffbf240c9eacc710b /crates
parent1f41eb28e2ab4df86134c02bdf5bf8299b4db008 (diff)
parent2890a1450ad4aa54362c6783c790422db193108c (diff)
Merge #1860
1860: remove confusing code r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir/src/nameres/collector.rs32
1 files changed, 1 insertions, 31 deletions
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
114 _ => i += 1, 114 _ => i += 1,
115 } 115 }
116 if i == 1000 { 116 if i == 1000 {
117 log::error!("diverging name resolution"); 117 log::error!("name resolution is stuck");
118 break; 118 break;
119 } 119 }
120 } 120 }
@@ -444,36 +444,6 @@ where
444 return false; 444 return false;
445 } 445 }
446 446
447 if resolved_res.reached_fixedpoint != ReachedFixedPoint::Yes {
448 let crate_name = &path.segments[0].name;
449
450 // FIXME:
451 // $crate are not handled in resolver right now
452 if crate_name.to_string() == "$crate" {
453 return true;
454 }
455
456 // FIXME:
457 // Currently `#[cfg(test)]` are ignored and cargo-metadata do not insert
458 // dev-dependencies of dependencies. For example,
459 // if we depend on parking lot, and parking lot has a dev-dependency on lazy_static.
460 // Then `lazy_static` wil not included in `CrateGraph`
461 // We can fix that by proper handling `cfg(test)`.
462 //
463 // So right now we set the fixpoint to No only if its crate is in CrateGraph
464 // See issue #1282 for details
465 let krate =
466 match self.def_map.resolve_name_in_extern_prelude(crate_name).take_types() {
467 Some(ModuleDef::Module(m)) => m.krate(self.db),
468 _ => return true,
469 };
470 if krate.is_none() {
471 return true;
472 }
473
474 res = resolved_res.reached_fixedpoint;
475 }
476
477 true 447 true
478 }); 448 });
479 449