@@ -21,7 +21,7 @@ use rustc_data_structures::sync::Lrc;
2121use std:: fmt:: Debug ;
2222use syntax_pos:: DUMMY_SP ;
2323use traits:: query:: { Fallible , NoSolution } ;
24- use traits:: { FulfillmentContext , TraitEngine } ;
24+ use traits:: TraitEngine ;
2525use traits:: { Obligation , ObligationCause , PredicateObligation } ;
2626use ty:: fold:: TypeFoldable ;
2727use ty:: subst:: { Kind , UnpackedKind } ;
@@ -48,7 +48,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxtBuilder<'cx, 'gcx, 'tcx> {
4848 pub fn enter_canonical_trait_query < K , R > (
4949 & ' tcx mut self ,
5050 canonical_key : & Canonical < ' tcx , K > ,
51- operation : impl FnOnce ( & InferCtxt < ' _ , ' gcx , ' tcx > , & mut FulfillmentContext < ' tcx > , K )
51+ operation : impl FnOnce ( & InferCtxt < ' _ , ' gcx , ' tcx > , & mut dyn TraitEngine < ' tcx > , K )
5252 -> Fallible < R > ,
5353 ) -> Fallible < CanonicalizedQueryResponse < ' gcx , R > >
5454 where
@@ -59,9 +59,13 @@ impl<'cx, 'gcx, 'tcx> InferCtxtBuilder<'cx, 'gcx, 'tcx> {
5959 DUMMY_SP ,
6060 canonical_key,
6161 |ref infcx, key, canonical_inference_vars| {
62- let fulfill_cx = & mut FulfillmentContext :: new ( ) ;
63- let value = operation ( infcx, fulfill_cx, key) ?;
64- infcx. make_canonicalized_query_response ( canonical_inference_vars, value, fulfill_cx)
62+ let mut fulfill_cx = TraitEngine :: new ( infcx. tcx ) ;
63+ let value = operation ( infcx, & mut * fulfill_cx, key) ?;
64+ infcx. make_canonicalized_query_response (
65+ canonical_inference_vars,
66+ value,
67+ & mut * fulfill_cx
68+ )
6569 } ,
6670 )
6771 }
@@ -91,7 +95,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
9195 & self ,
9296 inference_vars : CanonicalVarValues < ' tcx > ,
9397 answer : T ,
94- fulfill_cx : & mut FulfillmentContext < ' tcx > ,
98+ fulfill_cx : & mut dyn TraitEngine < ' tcx > ,
9599 ) -> Fallible < CanonicalizedQueryResponse < ' gcx , T > >
96100 where
97101 T : Debug + Lift < ' gcx > + TypeFoldable < ' tcx > ,
@@ -138,7 +142,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
138142 & self ,
139143 inference_vars : CanonicalVarValues < ' tcx > ,
140144 answer : T ,
141- fulfill_cx : & mut FulfillmentContext < ' tcx > ,
145+ fulfill_cx : & mut dyn TraitEngine < ' tcx > ,
142146 ) -> Result < QueryResponse < ' tcx , T > , NoSolution >
143147 where
144148 T : Debug + TypeFoldable < ' tcx > + Lift < ' gcx > ,
0 commit comments