aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_tree/lower.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-06-14 20:42:43 +0100
committerAleksey Kladov <[email protected]>2021-06-14 20:42:43 +0100
commitc2015e7d182f3cb2cebe686127dd6a3e683df9e6 (patch)
treeeb46a7d8ad5f0549fd79a51268d79859a1cb6c2d /crates/hir_def/src/item_tree/lower.rs
parent4cfc767d7fadeab025227d67f104065c9e8a55d3 (diff)
internal: more natural order of sources for TypeParam
We usually use first (left) variant of `Either` for "usual" case, and use right for odd things. For example, pat source is Pat | SelfParam.
Diffstat (limited to 'crates/hir_def/src/item_tree/lower.rs')
-rw-r--r--crates/hir_def/src/item_tree/lower.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs
index 3f90bda74..5b1386406 100644
--- a/crates/hir_def/src/item_tree/lower.rs
+++ b/crates/hir_def/src/item_tree/lower.rs
@@ -674,7 +674,7 @@ impl<'a> Ctx<'a> {
674 default: None, 674 default: None,
675 provenance: TypeParamProvenance::TraitSelf, 675 provenance: TypeParamProvenance::TraitSelf,
676 }); 676 });
677 sm.type_params.insert(self_param_id, Either::Left(trait_def.clone())); 677 sm.type_params.insert(self_param_id, Either::Right(trait_def.clone()));
678 // add super traits as bounds on Self 678 // add super traits as bounds on Self
679 // i.e., trait Foo: Bar is equivalent to trait Foo where Self: Bar 679 // i.e., trait Foo: Bar is equivalent to trait Foo where Self: Bar
680 let self_param = TypeRef::Path(name![Self].into()); 680 let self_param = TypeRef::Path(name![Self].into());