Use Chalk Environment more directly

This commit is contained in:
Florian Diebold 2021-03-12 19:12:17 +01:00
parent c0459c5357
commit ec70387a4c
5 changed files with 44 additions and 55 deletions

View file

@ -528,8 +528,7 @@ fn iterate_trait_method_candidates(
self_ty.value.dyn_trait().into_iter().flat_map(|t| all_super_traits(db.upcast(), t));
let env_traits = if let Ty::Placeholder(_) = self_ty.value {
// if we have `T: Trait` in the param env, the trait doesn't need to be in scope
env.trait_predicates_for_self_ty(&self_ty.value)
.map(|tr| tr.trait_)
env.traits_in_scope_from_clauses(&self_ty.value)
.flat_map(|t| all_super_traits(db.upcast(), t))
.collect()
} else {