aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-06-17 16:37:14 +0100
committerLukas Wirth <[email protected]>2021-06-17 16:37:14 +0100
commit95c8c65139c10e4de44367fead8dff88511e6d46 (patch)
tree4326d46ee282c133123f3a08aaee7d640f007050 /crates/hir
parentc82a9141abe6b6cbf5b55710dc8a315a3839081b (diff)
Nest all the or-patterns!
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/semantics.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs
index 613266e07..43162797e 100644
--- a/crates/hir/src/semantics.rs
+++ b/crates/hir/src/semantics.rs
@@ -51,12 +51,14 @@ impl PathResolution {
51 PathResolution::Def(ModuleDef::BuiltinType(builtin)) => { 51 PathResolution::Def(ModuleDef::BuiltinType(builtin)) => {
52 Some(TypeNs::BuiltinType((*builtin).into())) 52 Some(TypeNs::BuiltinType((*builtin).into()))
53 } 53 }
54 PathResolution::Def(ModuleDef::Const(_)) 54 PathResolution::Def(
55 | PathResolution::Def(ModuleDef::Variant(_)) 55 ModuleDef::Const(_)
56 | PathResolution::Def(ModuleDef::Function(_)) 56 | ModuleDef::Variant(_)
57 | PathResolution::Def(ModuleDef::Module(_)) 57 | ModuleDef::Function(_)
58 | PathResolution::Def(ModuleDef::Static(_)) 58 | ModuleDef::Module(_)
59 | PathResolution::Def(ModuleDef::Trait(_)) => None, 59 | ModuleDef::Static(_)
60 | ModuleDef::Trait(_),
61 ) => None,
60 PathResolution::Def(ModuleDef::TypeAlias(alias)) => { 62 PathResolution::Def(ModuleDef::TypeAlias(alias)) => {
61 Some(TypeNs::TypeAliasId((*alias).into())) 63 Some(TypeNs::TypeAliasId((*alias).into()))
62 } 64 }
@@ -65,8 +67,7 @@ impl PathResolution {
65 } 67 }
66 PathResolution::TypeParam(param) => Some(TypeNs::GenericParam((*param).into())), 68 PathResolution::TypeParam(param) => Some(TypeNs::GenericParam((*param).into())),
67 PathResolution::SelfType(impl_def) => Some(TypeNs::SelfType((*impl_def).into())), 69 PathResolution::SelfType(impl_def) => Some(TypeNs::SelfType((*impl_def).into())),
68 PathResolution::AssocItem(AssocItem::Const(_)) 70 PathResolution::AssocItem(AssocItem::Const(_) | AssocItem::Function(_)) => None,
69 | PathResolution::AssocItem(AssocItem::Function(_)) => None,
70 PathResolution::AssocItem(AssocItem::TypeAlias(alias)) => { 71 PathResolution::AssocItem(AssocItem::TypeAlias(alias)) => {
71 Some(TypeNs::TypeAliasId((*alias).into())) 72 Some(TypeNs::TypeAliasId((*alias).into()))
72 } 73 }