Handle Self in values and patterns

I.e.
 - `Self(x)` or `Self` in tuple/unit struct impls
 - `Self::Variant(x)` or `Self::Variant` in enum impls
 - the same in patterns

Fixes #4454.
This commit is contained in:
Florian Diebold 2020-05-15 17:15:40 +02:00
parent d51c1f6217
commit 3f42b2e837
6 changed files with 197 additions and 19 deletions

View file

@ -417,6 +417,7 @@ pub(crate) fn resolve_hir_path(
ValueNs::StaticId(it) => PathResolution::Def(Static::from(it).into()),
ValueNs::StructId(it) => PathResolution::Def(Struct::from(it).into()),
ValueNs::EnumVariantId(it) => PathResolution::Def(EnumVariant::from(it).into()),
ValueNs::ImplSelf(impl_id) => PathResolution::SelfType(impl_id.into()),
};
Some(res)
});