Use TraitEngine in more places that don't specifically need FulfillmentCtxt::new_in_snapshot
This commit is contained in:
parent
6dbae3ad19
commit
58f107ab56
11 changed files with 23 additions and 22 deletions
|
@ -5,7 +5,7 @@
|
|||
|
||||
use crate::infer::{DefiningAnchor, TyCtxtInferExt};
|
||||
use crate::traits::{
|
||||
FulfillmentContext, ImplSource, Obligation, ObligationCause, SelectionContext, TraitEngine,
|
||||
ImplSource, Obligation, ObligationCause, SelectionContext, TraitEngine, TraitEngineExt,
|
||||
Unimplemented,
|
||||
};
|
||||
use rustc_middle::traits::CodegenObligationError;
|
||||
|
@ -55,7 +55,7 @@ pub fn codegen_fulfill_obligation<'tcx>(
|
|||
// Currently, we use a fulfillment context to completely resolve
|
||||
// all nested obligations. This is because they can inform the
|
||||
// inference of the impl's type parameters.
|
||||
let mut fulfill_cx = FulfillmentContext::new();
|
||||
let mut fulfill_cx = <dyn TraitEngine<'tcx>>::new(tcx);
|
||||
let impl_source = selection.map(|predicate| {
|
||||
fulfill_cx.register_predicate_obligation(&infcx, predicate);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue