This repository was archived by the owner on May 28, 2025. It is now read-only.
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> {
36
36
37
37
impl < ' tcx > FulfillmentCtxt < ' tcx > {
38
38
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
+ ) ;
39
44
FulfillmentCtxt { obligations : Vec :: new ( ) , usable_in_snapshot : infcx. num_open_snapshots ( ) }
40
45
}
41
46
}
Original file line number Diff line number Diff line change @@ -80,6 +80,11 @@ static_assert_size!(PendingPredicateObligation<'_>, 72);
80
80
impl < ' tcx > FulfillmentContext < ' tcx > {
81
81
/// Creates a new fulfillment context.
82
82
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
+ ) ;
83
88
FulfillmentContext {
84
89
predicates : ObligationForest :: new ( ) ,
85
90
usable_in_snapshot : infcx. num_open_snapshots ( ) ,
You can’t perform that action at this time.
0 commit comments