mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Intern more TypeRef
s in generics
Saves ~3 MB
This commit is contained in:
parent
19e09a4a54
commit
24e876b52e
4 changed files with 15 additions and 14 deletions
|
@ -32,11 +32,10 @@ fn direct_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> Vec<TraitId> {
|
|||
.filter_map(|pred| match pred {
|
||||
WherePredicate::ForLifetime { target, bound, .. }
|
||||
| WherePredicate::TypeBound { target, bound } => match target {
|
||||
WherePredicateTypeTarget::TypeRef(TypeRef::Path(p))
|
||||
if p == &Path::from(name![Self]) =>
|
||||
{
|
||||
bound.as_path()
|
||||
}
|
||||
WherePredicateTypeTarget::TypeRef(type_ref) => match &**type_ref {
|
||||
TypeRef::Path(p) if p == &Path::from(name![Self]) => bound.as_path(),
|
||||
_ => None,
|
||||
},
|
||||
WherePredicateTypeTarget::TypeParam(local_id) if Some(*local_id) == trait_self => {
|
||||
bound.as_path()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue