diff options
author | Aleksey Kladov <[email protected]> | 2019-11-26 13:59:24 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-26 14:44:43 +0000 |
commit | 4a0792362e2c6cae2809520da454471d5a917384 (patch) | |
tree | e0205440b58772a43f13e2a4c547f1b7008efe46 /crates/ra_hir/src/ty/method_resolution.rs | |
parent | 4d753fa6f514ea1105c25ace91201c5324ee0b92 (diff) |
Detangle ty from traits a bit
Diffstat (limited to 'crates/ra_hir/src/ty/method_resolution.rs')
-rw-r--r-- | crates/ra_hir/src/ty/method_resolution.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index 489fcd64b..0e18684ed 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs | |||
@@ -16,7 +16,7 @@ use rustc_hash::FxHashMap; | |||
16 | use crate::{ | 16 | use crate::{ |
17 | db::HirDatabase, | 17 | db::HirDatabase, |
18 | ty::primitive::{FloatBitness, Uncertain}, | 18 | ty::primitive::{FloatBitness, Uncertain}, |
19 | ty::{Ty, TypeCtor}, | 19 | ty::{utils::all_super_traits, Ty, TypeCtor}, |
20 | AssocItem, Crate, Function, Mutability, Name, Trait, | 20 | AssocItem, Crate, Function, Mutability, Name, Trait, |
21 | }; | 21 | }; |
22 | 22 | ||
@@ -249,7 +249,8 @@ fn iterate_trait_method_candidates<T>( | |||
249 | let traits_from_env = env | 249 | let traits_from_env = env |
250 | .trait_predicates_for_self_ty(&ty.value) | 250 | .trait_predicates_for_self_ty(&ty.value) |
251 | .map(|tr| tr.trait_) | 251 | .map(|tr| tr.trait_) |
252 | .flat_map(|t| t.all_super_traits(db)); | 252 | .flat_map(|t| all_super_traits(db, t.id)) |
253 | .map(Trait::from); | ||
253 | let traits = inherent_trait | 254 | let traits = inherent_trait |
254 | .chain(traits_from_env) | 255 | .chain(traits_from_env) |
255 | .chain(resolver.traits_in_scope(db).into_iter().map(Trait::from)); | 256 | .chain(resolver.traits_in_scope(db).into_iter().map(Trait::from)); |