Skip to content

Commit 37d412c

Browse files
Remove FulfillmentContext param from fully_normalize
1 parent da59fa7 commit 37d412c

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

compiler/rustc_trait_selection/src/traits/coherence.rs

-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ fn negative_impl<'cx, 'tcx>(
302302
let impl_env = tcx.param_env(impl1_def_id);
303303
let subject1 = match traits::fully_normalize(
304304
&infcx,
305-
FulfillmentContext::new(),
306305
ObligationCause::dummy(),
307306
impl_env,
308307
tcx.impl_subject(impl1_def_id),

compiler/rustc_trait_selection/src/traits/misc.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ pub fn can_type_implement_copy<'tcx>(
6363
} else {
6464
ObligationCause::dummy_with_span(span)
6565
};
66-
let ctx = traits::FulfillmentContext::new();
67-
match traits::fully_normalize(&infcx, ctx, cause, param_env, ty) {
66+
match traits::fully_normalize(&infcx, cause, param_env, ty) {
6867
Ok(ty) => {
6968
if !infcx.type_is_copy_modulo_regions(param_env, ty, span) {
7069
infringing.push((field, ty));

compiler/rustc_trait_selection/src/traits/mod.rs

+10-11
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,13 @@ fn do_normalize_predicates<'tcx>(
222222
// them here too, and we will remove this function when
223223
// we move over to lazy normalization *anyway*.
224224
tcx.infer_ctxt().ignoring_regions().enter(|infcx| {
225-
let fulfill_cx = FulfillmentContext::new();
226-
let predicates =
227-
match fully_normalize(&infcx, fulfill_cx, cause, elaborated_env, predicates) {
228-
Ok(predicates) => predicates,
229-
Err(errors) => {
230-
let reported = infcx.report_fulfillment_errors(&errors, None, false);
231-
return Err(reported);
232-
}
233-
};
225+
let predicates = match fully_normalize(&infcx, cause, elaborated_env, predicates) {
226+
Ok(predicates) => predicates,
227+
Err(errors) => {
228+
let reported = infcx.report_fulfillment_errors(&errors, None, false);
229+
return Err(reported);
230+
}
231+
};
234232

235233
debug!("do_normalize_predictes: normalized predicates = {:?}", predicates);
236234

@@ -383,7 +381,6 @@ pub fn normalize_param_env_or_error<'tcx>(
383381

384382
pub fn fully_normalize<'a, 'tcx, T>(
385383
infcx: &InferCtxt<'a, 'tcx>,
386-
mut fulfill_cx: FulfillmentContext<'tcx>,
387384
cause: ObligationCause<'tcx>,
388385
param_env: ty::ParamEnv<'tcx>,
389386
value: T,
@@ -399,8 +396,10 @@ where
399396
"fully_normalize: normalized_value={:?} obligations={:?}",
400397
normalized_value, obligations
401398
);
399+
400+
let mut fulfill_cx = FulfillmentContext::new();
402401
for obligation in obligations {
403-
fulfill_cx.register_predicate_obligation(selcx.infcx(), obligation);
402+
fulfill_cx.register_predicate_obligation(infcx, obligation);
404403
}
405404

406405
debug!("fully_normalize: select_all_or_error start");

compiler/rustc_trait_selection/src/traits/specialize/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ pub(super) fn specializes(tcx: TyCtxt<'_>, (impl1_def_id, impl2_def_id): (DefId,
153153
tcx.infer_ctxt().enter(|infcx| {
154154
let impl1_trait_ref = match traits::fully_normalize(
155155
&infcx,
156-
FulfillmentContext::new(),
157156
ObligationCause::dummy(),
158157
penv,
159158
impl1_trait_ref,

0 commit comments

Comments
 (0)