1
Fork 0

Convert predicates into Predicate in the Obligation constructor

This commit is contained in:
Oli Scherer 2022-11-09 10:49:28 +00:00
parent 634df06fae
commit 4f11f3b257
49 changed files with 252 additions and 228 deletions

View file

@ -26,7 +26,7 @@ fn evaluate_obligation<'tcx>(
let ParamEnvAnd { param_env, value: predicate } = goal;
let mut selcx = SelectionContext::with_query_mode(&infcx, TraitQueryMode::Canonical);
let obligation = Obligation::new(ObligationCause::dummy(), param_env, predicate);
let obligation = Obligation::new(tcx, ObligationCause::dummy(), param_env, predicate);
selcx.evaluate_root_obligation(&obligation)
}

View file

@ -91,7 +91,12 @@ impl<'me, 'tcx> AscribeUserTypeCx<'me, 'tcx> {
}
fn prove_predicate(&self, predicate: Predicate<'tcx>, cause: ObligationCause<'tcx>) {
self.ocx.register_obligation(Obligation::new(cause, self.param_env, predicate));
self.ocx.register_obligation(Obligation::new(
self.ocx.infcx.tcx,
cause,
self.param_env,
predicate,
));
}
fn tcx(&self) -> TyCtxt<'tcx> {
@ -256,5 +261,5 @@ pub fn type_op_prove_predicate_with_cause<'tcx>(
cause: ObligationCause<'tcx>,
) {
let (param_env, ProvePredicate { predicate }) = key.into_parts();
ocx.register_obligation(Obligation::new(cause, param_env, predicate));
ocx.register_obligation(Obligation::new(ocx.infcx.tcx, cause, param_env, predicate));
}