diff options
-rw-r--r-- | crates/ra_cli/src/main.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/nameres/collector.rs | 32 |
2 files changed, 2 insertions, 32 deletions
diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index ca9275cd4..7aacf515d 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs | |||
@@ -29,7 +29,7 @@ impl Verbosity { | |||
29 | } | 29 | } |
30 | 30 | ||
31 | fn main() -> Result<()> { | 31 | fn main() -> Result<()> { |
32 | Logger::with_env().start()?; | 32 | Logger::with_env_or_str("error").start()?; |
33 | 33 | ||
34 | let subcommand = match std::env::args_os().nth(1) { | 34 | let subcommand = match std::env::args_os().nth(1) { |
35 | None => { | 35 | None => { |
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 | ||