1
Fork 0

Replace tcx.mk_trait_ref with ty::TraitRef::new

This commit is contained in:
Maybe Waffle 2023-04-25 16:07:48 +00:00
parent 2d8c905e15
commit 46b01abbcd
41 changed files with 193 additions and 125 deletions

View file

@ -261,11 +261,16 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
(false, None, None, Some(span), String::new())
};
let expected_trait_ref = self
.cx
.resolve_vars_if_possible(self.cx.tcx.mk_trait_ref(trait_def_id, expected_substs));
let actual_trait_ref =
self.cx.resolve_vars_if_possible(self.cx.tcx.mk_trait_ref(trait_def_id, actual_substs));
let expected_trait_ref = self.cx.resolve_vars_if_possible(ty::TraitRef::new(
self.cx.tcx,
trait_def_id,
expected_substs,
));
let actual_trait_ref = self.cx.resolve_vars_if_possible(ty::TraitRef::new(
self.cx.tcx,
trait_def_id,
actual_substs,
));
// Search the expected and actual trait references to see (a)
// whether the sub/sup placeholders appear in them (sometimes

View file

@ -18,7 +18,7 @@ pub trait TraitEngine<'tcx>: 'tcx {
def_id: DefId,
cause: ObligationCause<'tcx>,
) {
let trait_ref = infcx.tcx.mk_trait_ref(def_id, [ty]);
let trait_ref = ty::TraitRef::new(infcx.tcx, def_id, [ty]);
self.register_predicate_obligation(
infcx,
Obligation {