@@ -14,7 +14,9 @@ use specialization_graph::GraphExt;
1414
1515use crate :: infer:: { InferCtxt , InferOk , TyCtxtInferExt } ;
1616use crate :: traits:: select:: IntercrateAmbiguityCause ;
17- use crate :: traits:: { self , coherence, FutureCompatOverlapErrorKind , ObligationCause , TraitEngine } ;
17+ use crate :: traits:: {
18+ self , coherence, FutureCompatOverlapErrorKind , ObligationCause , TraitEngine , TraitEngineExt ,
19+ } ;
1820use rustc_data_structures:: fx:: { FxHashSet , FxIndexSet } ;
1921use rustc_errors:: { struct_span_err, EmissionGuarantee , LintDiagnosticBuilder } ;
2022use rustc_hir:: def_id:: { DefId , LocalDefId } ;
@@ -24,8 +26,8 @@ use rustc_session::lint::builtin::COHERENCE_LEAK_CHECK;
2426use rustc_session:: lint:: builtin:: ORDER_DEPENDENT_TRAIT_OBJECTS ;
2527use rustc_span:: { Span , DUMMY_SP } ;
2628
27- use super :: util ;
28- use super :: { FulfillmentContext , SelectionContext } ;
29+ use super :: SelectionContext ;
30+ use super :: { util , FulfillmentContext } ;
2931
3032/// Information pertinent to an overlapping impl error.
3133#[ derive( Debug ) ]
@@ -207,7 +209,7 @@ fn fulfill_implication<'a, 'tcx>(
207209 // (which are packed up in penv)
208210
209211 infcx. save_and_restore_in_snapshot_flag ( |infcx| {
210- let mut fulfill_cx = FulfillmentContext :: new ( ) ;
212+ let mut fulfill_cx = < dyn TraitEngine < ' tcx > > :: new ( infcx . tcx ) ;
211213 for oblig in obligations. chain ( more_obligations) {
212214 fulfill_cx. register_predicate_obligation ( & infcx, oblig) ;
213215 }
0 commit comments