aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/utils.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-13 11:12:36 +0000
committerAleksey Kladov <[email protected]>2019-12-14 18:15:40 +0000
commit2619950b3b405324ab1c1745876165c834b3b4b9 (patch)
tree1f32b3f34bbdad0d58b3cbddf250c350cd546de6 /crates/ra_hir_ty/src/utils.rs
parentf720855e1e45985463e31e0a6a2a76bb6ffd1cfa (diff)
Use different types for path with and without generics
Diffstat (limited to 'crates/ra_hir_ty/src/utils.rs')
-rw-r--r--crates/ra_hir_ty/src/utils.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/utils.rs b/crates/ra_hir_ty/src/utils.rs
index 0049d3c6f..29799a8cb 100644
--- a/crates/ra_hir_ty/src/utils.rs
+++ b/crates/ra_hir_ty/src/utils.rs
@@ -6,6 +6,7 @@ use hir_def::{
6 adt::VariantData, 6 adt::VariantData,
7 db::DefDatabase, 7 db::DefDatabase,
8 generics::{GenericParams, TypeParamData}, 8 generics::{GenericParams, TypeParamData},
9 path::Path,
9 resolver::{HasResolver, TypeNs}, 10 resolver::{HasResolver, TypeNs},
10 type_ref::TypeRef, 11 type_ref::TypeRef,
11 ContainerId, GenericDefId, Lookup, TraitId, TypeAliasId, TypeParamId, VariantId, 12 ContainerId, GenericDefId, Lookup, TraitId, TypeAliasId, TypeParamId, VariantId,
@@ -22,10 +23,10 @@ fn direct_super_traits(db: &impl DefDatabase, trait_: TraitId) -> Vec<TraitId> {
22 .where_predicates 23 .where_predicates
23 .iter() 24 .iter()
24 .filter_map(|pred| match &pred.type_ref { 25 .filter_map(|pred| match &pred.type_ref {
25 TypeRef::Path(p) if p.as_ident() == Some(&name![Self]) => pred.bound.as_path(), 26 TypeRef::Path(p) if p == &Path::from(name![Self]) => pred.bound.as_path(),
26 _ => None, 27 _ => None,
27 }) 28 })
28 .filter_map(|path| match resolver.resolve_path_in_type_ns_fully(db, path) { 29 .filter_map(|path| match resolver.resolve_path_in_type_ns_fully(db, path.mod_path()) {
29 Some(TypeNs::TraitId(t)) => Some(t), 30 Some(TypeNs::TraitId(t)) => Some(t),
30 _ => None, 31 _ => None,
31 }) 32 })