diff options
Diffstat (limited to 'crates/ra_hir_ty/src/utils.rs')
-rw-r--r-- | crates/ra_hir_ty/src/utils.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/utils.rs b/crates/ra_hir_ty/src/utils.rs index aeb211a91..fabf45b53 100644 --- a/crates/ra_hir_ty/src/utils.rs +++ b/crates/ra_hir_ty/src/utils.rs | |||
@@ -10,10 +10,8 @@ use hir_def::{ | |||
10 | type_ref::TypeRef, | 10 | type_ref::TypeRef, |
11 | ContainerId, GenericDefId, Lookup, TraitId, TypeAliasId, TypeParamId, VariantId, | 11 | ContainerId, GenericDefId, Lookup, TraitId, TypeAliasId, TypeParamId, VariantId, |
12 | }; | 12 | }; |
13 | use hir_expand::name::{self, Name}; | 13 | use hir_expand::name::{Name, N}; |
14 | 14 | ||
15 | // FIXME: this is wrong, b/c it can't express `trait T: PartialEq<()>`. | ||
16 | // We should return a `TraitREf` here. | ||
17 | fn direct_super_traits(db: &impl DefDatabase, trait_: TraitId) -> Vec<TraitId> { | 15 | fn direct_super_traits(db: &impl DefDatabase, trait_: TraitId) -> Vec<TraitId> { |
18 | let resolver = trait_.resolver(db); | 16 | let resolver = trait_.resolver(db); |
19 | // returning the iterator directly doesn't easily work because of | 17 | // returning the iterator directly doesn't easily work because of |
@@ -24,7 +22,7 @@ fn direct_super_traits(db: &impl DefDatabase, trait_: TraitId) -> Vec<TraitId> { | |||
24 | .where_predicates | 22 | .where_predicates |
25 | .iter() | 23 | .iter() |
26 | .filter_map(|pred| match &pred.type_ref { | 24 | .filter_map(|pred| match &pred.type_ref { |
27 | TypeRef::Path(p) if p.as_ident() == Some(&name::SELF_TYPE) => pred.bound.as_path(), | 25 | TypeRef::Path(p) if p.as_ident() == Some(&N![Self]) => pred.bound.as_path(), |
28 | _ => None, | 26 | _ => None, |
29 | }) | 27 | }) |
30 | .filter_map(|path| match resolver.resolve_path_in_type_ns_fully(db, path) { | 28 | .filter_map(|path| match resolver.resolve_path_in_type_ns_fully(db, path) { |