1
Fork 0

Compute all_traits_impls during resolution.

This commit is contained in:
Camille GILLOT 2021-07-16 21:55:10 +02:00
parent 26eeec0baf
commit 635978041d
8 changed files with 17 additions and 18 deletions

View file

@ -383,15 +383,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
this.lower_trait_ref(trait_ref, ImplTraitContext::disallowed())
});
if let Some(ref trait_ref) = trait_ref {
if let Res::Def(DefKind::Trait, def_id) = trait_ref.path.res {
this.trait_impls
.entry(def_id)
.or_default()
.push(lowered_trait_def_id);
}
}
let lowered_ty = this.lower_ty(ty, ImplTraitContext::disallowed());
(trait_ref, lowered_ty)

View file

@ -104,8 +104,6 @@ struct LoweringContext<'a, 'hir: 'a> {
owners: IndexVec<LocalDefId, Option<hir::OwnerNode<'hir>>>,
bodies: BTreeMap<hir::BodyId, hir::Body<'hir>>,
trait_impls: BTreeMap<DefId, Vec<LocalDefId>>,
modules: BTreeMap<LocalDefId, hir::ModuleItems>,
generator_kind: Option<hir::GeneratorKind>,
@ -324,7 +322,6 @@ pub fn lower_crate<'a, 'hir>(
arena,
owners: IndexVec::default(),
bodies: BTreeMap::new(),
trait_impls: BTreeMap::new(),
modules: BTreeMap::new(),
attrs: BTreeMap::default(),
catch_scopes: Vec::new(),
@ -512,7 +509,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let krate = hir::Crate {
owners: self.owners,
bodies: self.bodies,
trait_impls: self.trait_impls,
modules: self.modules,
proc_macros,
trait_map,