diff options
author | Omer Ben-Amram <[email protected]> | 2019-12-14 15:29:30 +0000 |
---|---|---|
committer | Omer Ben-Amram <[email protected]> | 2019-12-14 15:29:30 +0000 |
commit | 5e4e713fc9c201852fc5fbafd57e5b9243149a78 (patch) | |
tree | 996b679a9ae1d07be1edd9eb04e93d433c6524a3 /crates/ra_hir_ty/src/utils.rs | |
parent | 083010f6339e558184f06ce76a18e1ad0b0ee936 (diff) | |
parent | 77db6177658b32f69ad7ebfdef96c1b3b2893fdd (diff) |
Merge branch 'refs/heads/master' into feature/granular-scopes
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..0049d3c6f 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, Name}; |
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(&name![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) { |