1
Fork 0

new_outside_solver -> evaluate_root_goal

This commit is contained in:
lcnr 2023-01-23 15:34:11 +01:00
parent 6b3cd03fdb
commit 033047a72c
2 changed files with 32 additions and 17 deletions

View file

@ -1,5 +1,6 @@
use std::mem;
use super::{Certainty, InferCtxtEvalExt};
use rustc_infer::{
infer::InferCtxt,
traits::{
@ -8,8 +9,6 @@ use rustc_infer::{
},
};
use super::{search_graph, Certainty, EvalCtxt};
/// A trait engine using the new trait solver.
///
/// This is mostly identical to how `evaluate_all` works inside of the
@ -66,9 +65,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
let mut has_changed = false;
for obligation in mem::take(&mut self.obligations) {
let goal = obligation.clone().into();
let search_graph = &mut search_graph::SearchGraph::new(infcx.tcx);
let mut ecx = EvalCtxt::new_outside_solver(infcx, search_graph);
let (changed, certainty) = match ecx.evaluate_goal(goal) {
let (changed, certainty) = match infcx.evaluate_root_goal(goal) {
Ok(result) => result,
Err(NoSolution) => {
errors.push(FulfillmentError {