diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/resolve.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 4 |
3 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index cd501d1f6..58db6832d 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -465,7 +465,7 @@ impl Enum { | |||
465 | // ...and add generic params, if present | 465 | // ...and add generic params, if present |
466 | let p = self.generic_params(db); | 466 | let p = self.generic_params(db); |
467 | let r = if !p.params.is_empty() { r.push_generic_params_scope(p) } else { r }; | 467 | let r = if !p.params.is_empty() { r.push_generic_params_scope(p) } else { r }; |
468 | r.push_scope(Scope::AdtScope(From::from(self))) | 468 | r.push_scope(Scope::AdtScope(self.into())) |
469 | } | 469 | } |
470 | } | 470 | } |
471 | 471 | ||
diff --git a/crates/ra_hir/src/resolve.rs b/crates/ra_hir/src/resolve.rs index c46f7e157..3c797c0c3 100644 --- a/crates/ra_hir/src/resolve.rs +++ b/crates/ra_hir/src/resolve.rs | |||
@@ -45,7 +45,7 @@ pub(crate) enum Scope { | |||
45 | GenericParams(Arc<GenericParams>), | 45 | GenericParams(Arc<GenericParams>), |
46 | /// Brings `Self` in `impl` block into scope | 46 | /// Brings `Self` in `impl` block into scope |
47 | ImplBlockScope(ImplBlock), | 47 | ImplBlockScope(ImplBlock), |
48 | /// Brings `Self` in enum definition into scope | 48 | /// Brings `Self` in enum, struct and union definitions into scope |
49 | AdtScope(Adt), | 49 | AdtScope(Adt), |
50 | /// Local bindings | 50 | /// Local bindings |
51 | ExprScope(ExprScope), | 51 | ExprScope(ExprScope), |
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 9e5d42509..a69f04ff1 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -559,9 +559,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
559 | match resolver.resolve_path_in_type_ns_fully(self.db, &path) { | 559 | match resolver.resolve_path_in_type_ns_fully(self.db, &path) { |
560 | Some(TypeNs::Adt(Adt::Struct(it))) => it.into(), | 560 | Some(TypeNs::Adt(Adt::Struct(it))) => it.into(), |
561 | Some(TypeNs::Adt(Adt::Union(it))) => it.into(), | 561 | Some(TypeNs::Adt(Adt::Union(it))) => it.into(), |
562 | Some(TypeNs::AdtSelfType(Adt::Struct(it))) => it.into(), | 562 | Some(TypeNs::AdtSelfType(adt)) => adt.into(), |
563 | Some(TypeNs::AdtSelfType(Adt::Union(it))) => it.into(), | ||
564 | Some(TypeNs::AdtSelfType(Adt::Enum(it))) => it.into(), | ||
565 | Some(TypeNs::EnumVariant(it)) => it.into(), | 563 | Some(TypeNs::EnumVariant(it)) => it.into(), |
566 | Some(TypeNs::TypeAlias(it)) => it.into(), | 564 | Some(TypeNs::TypeAlias(it)) => it.into(), |
567 | 565 | ||