File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
compiler/rustc_trait_selection/src Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ pub struct FulfillmentCtxt<'tcx> {
3636
3737impl < ' tcx > FulfillmentCtxt < ' tcx > {
3838 pub fn new ( infcx : & InferCtxt < ' tcx > ) -> FulfillmentCtxt < ' tcx > {
39+ assert ! (
40+ infcx. next_trait_solver( ) ,
41+ "new trait solver fulfillment context created when \
42+ infcx is set up for old trait solver"
43+ ) ;
3944 FulfillmentCtxt { obligations : Vec :: new ( ) , usable_in_snapshot : infcx. num_open_snapshots ( ) }
4045 }
4146}
Original file line number Diff line number Diff line change @@ -80,6 +80,11 @@ static_assert_size!(PendingPredicateObligation<'_>, 72);
8080impl < ' tcx > FulfillmentContext < ' tcx > {
8181 /// Creates a new fulfillment context.
8282 pub ( super ) fn new ( infcx : & InferCtxt < ' tcx > ) -> FulfillmentContext < ' tcx > {
83+ assert ! (
84+ !infcx. next_trait_solver( ) ,
85+ "old trait solver fulfillment context created when \
86+ infcx is set up for new trait solver"
87+ ) ;
8388 FulfillmentContext {
8489 predicates : ObligationForest :: new ( ) ,
8590 usable_in_snapshot : infcx. num_open_snapshots ( ) ,
You can’t perform that action at this time.
0 commit comments