Use ObligationCtxt in impossible_predicates
This commit is contained in:
parent
61d9b1656d
commit
3e48434cc7
1 changed files with 5 additions and 12 deletions
|
@ -427,20 +427,13 @@ pub fn impossible_predicates<'tcx>(
|
||||||
infcx.set_tainted_by_errors();
|
infcx.set_tainted_by_errors();
|
||||||
|
|
||||||
let param_env = ty::ParamEnv::reveal_all();
|
let param_env = ty::ParamEnv::reveal_all();
|
||||||
let mut selcx = SelectionContext::new(&infcx);
|
let ocx = ObligationCtxt::new(&infcx);
|
||||||
let mut fulfill_cx = FulfillmentContext::new();
|
let predicates = ocx.normalize(ObligationCause::dummy(), param_env, predicates);
|
||||||
let cause = ObligationCause::dummy();
|
|
||||||
let Normalized { value: predicates, obligations } =
|
|
||||||
normalize(&mut selcx, param_env, cause.clone(), predicates);
|
|
||||||
for obligation in obligations {
|
|
||||||
fulfill_cx.register_predicate_obligation(&infcx, obligation);
|
|
||||||
}
|
|
||||||
for predicate in predicates {
|
for predicate in predicates {
|
||||||
let obligation = Obligation::new(cause.clone(), param_env, predicate);
|
let obligation = Obligation::new(ObligationCause::dummy(), param_env, predicate);
|
||||||
fulfill_cx.register_predicate_obligation(&infcx, obligation);
|
ocx.register_obligation(obligation);
|
||||||
}
|
}
|
||||||
|
let errors = ocx.select_all_or_error();
|
||||||
let errors = fulfill_cx.select_all_or_error(&infcx);
|
|
||||||
|
|
||||||
// Clean up after ourselves
|
// Clean up after ourselves
|
||||||
let _ = infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types();
|
let _ = infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue