diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-10-08 12:46:14 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-10-08 12:46:14 +0100 |
commit | 92cf0eba93b8d2705ed39bef1a4ea665ed3c25dc (patch) | |
tree | a015a8a8162acacb61b3353b4642c93cd80e51ae /crates/ra_hir/src/ty/infer.rs | |
parent | 93199002af05f3a3dfd274fe10633372f2471b73 (diff) | |
parent | b043358be936b7f139efd49b7d187d64e319830e (diff) |
Merge #1924
1924: Support inferring&completing `Self` type in enum/struct/union definitions r=ice1000 a=ice1000
Signed-off-by: ice1000 <[email protected]>
An attempt to fix #1908.
This code works, but I believe the implementation is ugly. Please give me suggestions!
Co-authored-by: ice1000 <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/infer.rs')
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index ca9aefc42..a69f04ff1 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -559,6 +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)) => adt.into(), | ||
562 | Some(TypeNs::EnumVariant(it)) => it.into(), | 563 | Some(TypeNs::EnumVariant(it)) => it.into(), |
563 | Some(TypeNs::TypeAlias(it)) => it.into(), | 564 | Some(TypeNs::TypeAlias(it)) => it.into(), |
564 | 565 | ||