Remove FulfillmentContext param from fully_normalize

This commit is contained in:
Michael Goulet 2022-07-26 03:24:16 +00:00
parent da59fa74f0
commit 37d412cff7
4 changed files with 11 additions and 15 deletions

View File

@ -302,7 +302,6 @@ fn negative_impl<'cx, 'tcx>(
let impl_env = tcx.param_env(impl1_def_id);
let subject1 = match traits::fully_normalize(
&infcx,
FulfillmentContext::new(),
ObligationCause::dummy(),
impl_env,
tcx.impl_subject(impl1_def_id),

View File

@ -63,8 +63,7 @@ pub fn can_type_implement_copy<'tcx>(
} else {
ObligationCause::dummy_with_span(span)
};
let ctx = traits::FulfillmentContext::new();
match traits::fully_normalize(&infcx, ctx, cause, param_env, ty) {
match traits::fully_normalize(&infcx, cause, param_env, ty) {
Ok(ty) => {
if !infcx.type_is_copy_modulo_regions(param_env, ty, span) {
infringing.push((field, ty));

View File

@ -222,9 +222,7 @@ fn do_normalize_predicates<'tcx>(
// them here too, and we will remove this function when
// we move over to lazy normalization *anyway*.
tcx.infer_ctxt().ignoring_regions().enter(|infcx| {
let fulfill_cx = FulfillmentContext::new();
let predicates =
match fully_normalize(&infcx, fulfill_cx, cause, elaborated_env, predicates) {
let predicates = match fully_normalize(&infcx, cause, elaborated_env, predicates) {
Ok(predicates) => predicates,
Err(errors) => {
let reported = infcx.report_fulfillment_errors(&errors, None, false);
@ -383,7 +381,6 @@ pub fn normalize_param_env_or_error<'tcx>(
pub fn fully_normalize<'a, 'tcx, T>(
infcx: &InferCtxt<'a, 'tcx>,
mut fulfill_cx: FulfillmentContext<'tcx>,
cause: ObligationCause<'tcx>,
param_env: ty::ParamEnv<'tcx>,
value: T,
@ -399,8 +396,10 @@ where
"fully_normalize: normalized_value={:?} obligations={:?}",
normalized_value, obligations
);
let mut fulfill_cx = FulfillmentContext::new();
for obligation in obligations {
fulfill_cx.register_predicate_obligation(selcx.infcx(), obligation);
fulfill_cx.register_predicate_obligation(infcx, obligation);
}
debug!("fully_normalize: select_all_or_error start");

View File

@ -153,7 +153,6 @@ pub(super) fn specializes(tcx: TyCtxt<'_>, (impl1_def_id, impl2_def_id): (DefId,
tcx.infer_ctxt().enter(|infcx| {
let impl1_trait_ref = match traits::fully_normalize(
&infcx,
FulfillmentContext::new(),
ObligationCause::dummy(),
penv,
impl1_trait_ref,