Remove FulfillmentContext param from fully_normalize
This commit is contained in:
parent
da59fa74f0
commit
37d412cff7
@ -302,7 +302,6 @@ fn negative_impl<'cx, 'tcx>(
|
|||||||
let impl_env = tcx.param_env(impl1_def_id);
|
let impl_env = tcx.param_env(impl1_def_id);
|
||||||
let subject1 = match traits::fully_normalize(
|
let subject1 = match traits::fully_normalize(
|
||||||
&infcx,
|
&infcx,
|
||||||
FulfillmentContext::new(),
|
|
||||||
ObligationCause::dummy(),
|
ObligationCause::dummy(),
|
||||||
impl_env,
|
impl_env,
|
||||||
tcx.impl_subject(impl1_def_id),
|
tcx.impl_subject(impl1_def_id),
|
||||||
|
@ -63,8 +63,7 @@ pub fn can_type_implement_copy<'tcx>(
|
|||||||
} else {
|
} else {
|
||||||
ObligationCause::dummy_with_span(span)
|
ObligationCause::dummy_with_span(span)
|
||||||
};
|
};
|
||||||
let ctx = traits::FulfillmentContext::new();
|
match traits::fully_normalize(&infcx, cause, param_env, ty) {
|
||||||
match traits::fully_normalize(&infcx, ctx, cause, param_env, ty) {
|
|
||||||
Ok(ty) => {
|
Ok(ty) => {
|
||||||
if !infcx.type_is_copy_modulo_regions(param_env, ty, span) {
|
if !infcx.type_is_copy_modulo_regions(param_env, ty, span) {
|
||||||
infringing.push((field, ty));
|
infringing.push((field, ty));
|
||||||
|
@ -222,9 +222,7 @@ fn do_normalize_predicates<'tcx>(
|
|||||||
// them here too, and we will remove this function when
|
// them here too, and we will remove this function when
|
||||||
// we move over to lazy normalization *anyway*.
|
// we move over to lazy normalization *anyway*.
|
||||||
tcx.infer_ctxt().ignoring_regions().enter(|infcx| {
|
tcx.infer_ctxt().ignoring_regions().enter(|infcx| {
|
||||||
let fulfill_cx = FulfillmentContext::new();
|
let predicates = match fully_normalize(&infcx, cause, elaborated_env, predicates) {
|
||||||
let predicates =
|
|
||||||
match fully_normalize(&infcx, fulfill_cx, cause, elaborated_env, predicates) {
|
|
||||||
Ok(predicates) => predicates,
|
Ok(predicates) => predicates,
|
||||||
Err(errors) => {
|
Err(errors) => {
|
||||||
let reported = infcx.report_fulfillment_errors(&errors, None, false);
|
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>(
|
pub fn fully_normalize<'a, 'tcx, T>(
|
||||||
infcx: &InferCtxt<'a, 'tcx>,
|
infcx: &InferCtxt<'a, 'tcx>,
|
||||||
mut fulfill_cx: FulfillmentContext<'tcx>,
|
|
||||||
cause: ObligationCause<'tcx>,
|
cause: ObligationCause<'tcx>,
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
value: T,
|
value: T,
|
||||||
@ -399,8 +396,10 @@ where
|
|||||||
"fully_normalize: normalized_value={:?} obligations={:?}",
|
"fully_normalize: normalized_value={:?} obligations={:?}",
|
||||||
normalized_value, obligations
|
normalized_value, obligations
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let mut fulfill_cx = FulfillmentContext::new();
|
||||||
for obligation in obligations {
|
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");
|
debug!("fully_normalize: select_all_or_error start");
|
||||||
|
@ -153,7 +153,6 @@ pub(super) fn specializes(tcx: TyCtxt<'_>, (impl1_def_id, impl2_def_id): (DefId,
|
|||||||
tcx.infer_ctxt().enter(|infcx| {
|
tcx.infer_ctxt().enter(|infcx| {
|
||||||
let impl1_trait_ref = match traits::fully_normalize(
|
let impl1_trait_ref = match traits::fully_normalize(
|
||||||
&infcx,
|
&infcx,
|
||||||
FulfillmentContext::new(),
|
|
||||||
ObligationCause::dummy(),
|
ObligationCause::dummy(),
|
||||||
penv,
|
penv,
|
||||||
impl1_trait_ref,
|
impl1_trait_ref,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user