aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/resolver.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/resolver.rs')
-rw-r--r--crates/ra_hir_def/src/resolver.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/ra_hir_def/src/resolver.rs b/crates/ra_hir_def/src/resolver.rs
index 9dd4fa555..2734d51a0 100644
--- a/crates/ra_hir_def/src/resolver.rs
+++ b/crates/ra_hir_def/src/resolver.rs
@@ -52,7 +52,7 @@ enum Scope {
52 /// Brings the generic parameters of an item into scope 52 /// Brings the generic parameters of an item into scope
53 GenericParams { def: GenericDefId, params: Arc<GenericParams> }, 53 GenericParams { def: GenericDefId, params: Arc<GenericParams> },
54 /// Brings `Self` in `impl` block into scope 54 /// Brings `Self` in `impl` block into scope
55 ImplBlockScope(ImplId), 55 ImplDefScope(ImplId),
56 /// Brings `Self` in enum, struct and union definitions into scope 56 /// Brings `Self` in enum, struct and union definitions into scope
57 AdtScope(AdtId), 57 AdtScope(AdtId),
58 /// Local bindings 58 /// Local bindings
@@ -154,7 +154,7 @@ impl Resolver {
154 match scope { 154 match scope {
155 Scope::ExprScope(_) => continue, 155 Scope::ExprScope(_) => continue,
156 Scope::GenericParams { .. } 156 Scope::GenericParams { .. }
157 | Scope::ImplBlockScope(_) 157 | Scope::ImplDefScope(_)
158 | Scope::LocalItemsScope(_) 158 | Scope::LocalItemsScope(_)
159 if skip_to_mod => 159 if skip_to_mod =>
160 { 160 {
@@ -170,7 +170,7 @@ impl Resolver {
170 )); 170 ));
171 } 171 }
172 } 172 }
173 Scope::ImplBlockScope(impl_) => { 173 Scope::ImplDefScope(impl_) => {
174 if first_name == &name![Self] { 174 if first_name == &name![Self] {
175 let idx = if path.segments.len() == 1 { None } else { Some(1) }; 175 let idx = if path.segments.len() == 1 { None } else { Some(1) };
176 return Some((TypeNs::SelfType(*impl_), idx)); 176 return Some((TypeNs::SelfType(*impl_), idx));
@@ -263,7 +263,7 @@ impl Resolver {
263 Scope::AdtScope(_) 263 Scope::AdtScope(_)
264 | Scope::ExprScope(_) 264 | Scope::ExprScope(_)
265 | Scope::GenericParams { .. } 265 | Scope::GenericParams { .. }
266 | Scope::ImplBlockScope(_) 266 | Scope::ImplDefScope(_)
267 | Scope::LocalItemsScope(_) 267 | Scope::LocalItemsScope(_)
268 if skip_to_mod => 268 if skip_to_mod =>
269 { 269 {
@@ -291,7 +291,7 @@ impl Resolver {
291 } 291 }
292 Scope::GenericParams { .. } => continue, 292 Scope::GenericParams { .. } => continue,
293 293
294 Scope::ImplBlockScope(impl_) if n_segments > 1 => { 294 Scope::ImplDefScope(impl_) if n_segments > 1 => {
295 if first_name == &name![Self] { 295 if first_name == &name![Self] {
296 let ty = TypeNs::SelfType(*impl_); 296 let ty = TypeNs::SelfType(*impl_);
297 return Some(ResolveValueResult::Partial(ty, 1)); 297 return Some(ResolveValueResult::Partial(ty, 1));
@@ -303,7 +303,7 @@ impl Resolver {
303 return Some(ResolveValueResult::Partial(ty, 1)); 303 return Some(ResolveValueResult::Partial(ty, 1));
304 } 304 }
305 } 305 }
306 Scope::ImplBlockScope(_) | Scope::AdtScope(_) => continue, 306 Scope::ImplDefScope(_) | Scope::AdtScope(_) => continue,
307 307
308 Scope::ModuleScope(m) => { 308 Scope::ModuleScope(m) => {
309 let (module_def, idx) = m.crate_def_map.resolve_path( 309 let (module_def, idx) = m.crate_def_map.resolve_path(
@@ -503,7 +503,7 @@ impl Scope {
503 } 503 }
504 } 504 }
505 } 505 }
506 Scope::ImplBlockScope(i) => { 506 Scope::ImplDefScope(i) => {
507 f(name![Self], ScopeDef::ImplSelfType(*i)); 507 f(name![Self], ScopeDef::ImplSelfType(*i));
508 } 508 }
509 Scope::AdtScope(i) => { 509 Scope::AdtScope(i) => {
@@ -550,8 +550,8 @@ impl Resolver {
550 self.push_scope(Scope::GenericParams { def, params }) 550 self.push_scope(Scope::GenericParams { def, params })
551 } 551 }
552 552
553 fn push_impl_block_scope(self, impl_block: ImplId) -> Resolver { 553 fn push_impl_def_scope(self, impl_def: ImplId) -> Resolver {
554 self.push_scope(Scope::ImplBlockScope(impl_block)) 554 self.push_scope(Scope::ImplDefScope(impl_def))
555 } 555 }
556 556
557 fn push_module_scope( 557 fn push_module_scope(
@@ -634,7 +634,7 @@ impl HasResolver for ImplId {
634 .container 634 .container
635 .resolver(db) 635 .resolver(db)
636 .push_generic_params_scope(db, self.into()) 636 .push_generic_params_scope(db, self.into())
637 .push_impl_block_scope(self) 637 .push_impl_def_scope(self)
638 } 638 }
639} 639}
640 640