aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/utils.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-04-05 01:03:37 +0100
committerJonas Schievink <[email protected]>2021-04-05 01:03:37 +0100
commit24e876b52ed76710593895bc37bb8ed303075193 (patch)
treec624f31447726b83b381067d2effc1e8849fd4a7 /crates/hir_ty/src/utils.rs
parent19e09a4a54c75312aeaac04577f2d0e067463ab6 (diff)
Intern more `TypeRef`s in generics
Saves ~3 MB
Diffstat (limited to 'crates/hir_ty/src/utils.rs')
-rw-r--r--crates/hir_ty/src/utils.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/hir_ty/src/utils.rs b/crates/hir_ty/src/utils.rs
index b23e91b1b..c85c328af 100644
--- a/crates/hir_ty/src/utils.rs
+++ b/crates/hir_ty/src/utils.rs
@@ -32,11 +32,10 @@ fn direct_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> Vec<TraitId> {
32 .filter_map(|pred| match pred { 32 .filter_map(|pred| match pred {
33 WherePredicate::ForLifetime { target, bound, .. } 33 WherePredicate::ForLifetime { target, bound, .. }
34 | WherePredicate::TypeBound { target, bound } => match target { 34 | WherePredicate::TypeBound { target, bound } => match target {
35 WherePredicateTypeTarget::TypeRef(TypeRef::Path(p)) 35 WherePredicateTypeTarget::TypeRef(type_ref) => match &**type_ref {
36 if p == &Path::from(name![Self]) => 36 TypeRef::Path(p) if p == &Path::from(name![Self]) => bound.as_path(),
37 { 37 _ => None,
38 bound.as_path() 38 },
39 }
40 WherePredicateTypeTarget::TypeParam(local_id) if Some(*local_id) == trait_self => { 39 WherePredicateTypeTarget::TypeParam(local_id) if Some(*local_id) == trait_self => {
41 bound.as_path() 40 bound.as_path()
42 } 41 }