Delegation: second attempt to improve perf
This commit is contained in:
@@ -115,13 +115,6 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
|
||||
None => {}
|
||||
}
|
||||
|
||||
// For a delegation item inherit predicates from callee.
|
||||
if let Some(sig_id) = tcx.hir().opt_delegation_sig_id(def_id)
|
||||
&& let Some(predicates) = inherit_predicates_for_delegation_item(tcx, def_id, sig_id)
|
||||
{
|
||||
return predicates;
|
||||
}
|
||||
|
||||
let hir_id = tcx.local_def_id_to_hir_id(def_id);
|
||||
let node = tcx.hir_node(hir_id);
|
||||
|
||||
@@ -151,6 +144,16 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
|
||||
ItemKind::Trait(_, _, _, self_bounds, ..) | ItemKind::TraitAlias(_, self_bounds) => {
|
||||
is_trait = Some(self_bounds);
|
||||
}
|
||||
|
||||
ItemKind::Fn(sig, _, _) => {
|
||||
// For a delegation item inherit predicates from callee.
|
||||
if let Some(sig_id) = sig.decl.opt_delegation_sig_id()
|
||||
&& let Some(predicates) =
|
||||
inherit_predicates_for_delegation_item(tcx, def_id, sig_id)
|
||||
{
|
||||
return predicates;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user