1
Fork 0

Don't install default projection bound for RPITITs

This commit is contained in:
Michael Goulet 2023-07-16 01:41:20 +00:00
parent a8be6e070f
commit 0f0ab89feb
4 changed files with 30 additions and 8 deletions

View file

@ -129,7 +129,9 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
// sure that this will succeed without errors anyway.
if tcx.def_kind(def_id) == DefKind::AssocFn
&& tcx.associated_item(def_id).container == ty::AssocItemContainer::TraitContainer
&& let assoc_item = tcx.associated_item(def_id)
&& assoc_item.container == ty::AssocItemContainer::TraitContainer
&& assoc_item.defaultness(tcx).has_value()
{
let sig = tcx.fn_sig(def_id).instantiate_identity();
// We accounted for the binder of the fn sig, so skip the binder.