aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/resolver.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/resolver.rs')
-rw-r--r--crates/hir_def/src/resolver.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs
index a505bf2be..d48029b7d 100644
--- a/crates/hir_def/src/resolver.rs
+++ b/crates/hir_def/src/resolver.rs
@@ -416,7 +416,7 @@ impl Resolver {
416 let mut traits = FxHashSet::default(); 416 let mut traits = FxHashSet::default();
417 for scope in &self.scopes { 417 for scope in &self.scopes {
418 if let Scope::ModuleScope(m) = scope { 418 if let Scope::ModuleScope(m) = scope {
419 if let Some(prelude) = m.crate_def_map.prelude { 419 if let Some(prelude) = m.crate_def_map.prelude() {
420 let prelude_def_map = db.crate_def_map(prelude.krate); 420 let prelude_def_map = db.crate_def_map(prelude.krate);
421 traits.extend(prelude_def_map[prelude.local_id].scope.traits()); 421 traits.extend(prelude_def_map[prelude.local_id].scope.traits());
422 } 422 }
@@ -446,11 +446,11 @@ impl Resolver {
446 446
447 pub fn module(&self) -> Option<ModuleId> { 447 pub fn module(&self) -> Option<ModuleId> {
448 let (def_map, local_id) = self.module_scope()?; 448 let (def_map, local_id) = self.module_scope()?;
449 Some(ModuleId { krate: def_map.krate, local_id }) 449 Some(ModuleId { krate: def_map.krate(), local_id })
450 } 450 }
451 451
452 pub fn krate(&self) -> Option<CrateId> { 452 pub fn krate(&self) -> Option<CrateId> {
453 self.module_scope().map(|t| t.0.krate) 453 self.module_scope().map(|t| t.0.krate())
454 } 454 }
455 455
456 pub fn where_predicates_in_scope<'a>( 456 pub fn where_predicates_in_scope<'a>(
@@ -509,13 +509,13 @@ impl Scope {
509 seen.insert((name.clone(), scope)); 509 seen.insert((name.clone(), scope));
510 f(name.clone(), ScopeDef::PerNs(scope)); 510 f(name.clone(), ScopeDef::PerNs(scope));
511 }); 511 });
512 m.crate_def_map.extern_prelude.iter().for_each(|(name, &def)| { 512 m.crate_def_map.extern_prelude().for_each(|(name, &def)| {
513 f(name.clone(), ScopeDef::PerNs(PerNs::types(def, Visibility::Public))); 513 f(name.clone(), ScopeDef::PerNs(PerNs::types(def, Visibility::Public)));
514 }); 514 });
515 BUILTIN_SCOPE.iter().for_each(|(name, &def)| { 515 BUILTIN_SCOPE.iter().for_each(|(name, &def)| {
516 f(name.clone(), ScopeDef::PerNs(def)); 516 f(name.clone(), ScopeDef::PerNs(def));
517 }); 517 });
518 if let Some(prelude) = m.crate_def_map.prelude { 518 if let Some(prelude) = m.crate_def_map.prelude() {
519 let prelude_def_map = db.crate_def_map(prelude.krate); 519 let prelude_def_map = db.crate_def_map(prelude.krate);
520 prelude_def_map[prelude.local_id].scope.entries().for_each(|(name, def)| { 520 prelude_def_map[prelude.local_id].scope.entries().for_each(|(name, def)| {
521 let seen_tuple = (name.clone(), def); 521 let seen_tuple = (name.clone(), def);