@@ -7,17 +7,17 @@ use crate::traits::{
7
7
ChalkEnvironmentAndGoal , ChalkEnvironmentClause , FulfillmentError , FulfillmentErrorCode ,
8
8
ObligationCause , PredicateObligation , SelectionError , TraitEngine ,
9
9
} ;
10
- use rustc_data_structures:: fx:: FxHashSet ;
10
+ use rustc_data_structures:: fx:: FxIndexSet ;
11
11
use rustc_hir:: def_id:: DefId ;
12
12
use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
13
13
14
14
pub struct FulfillmentContext < ' tcx > {
15
- obligations : FxHashSet < PredicateObligation < ' tcx > > ,
15
+ obligations : FxIndexSet < PredicateObligation < ' tcx > > ,
16
16
}
17
17
18
18
impl FulfillmentContext < ' tcx > {
19
19
crate fn new ( ) -> Self {
20
- FulfillmentContext { obligations : FxHashSet :: default ( ) }
20
+ FulfillmentContext { obligations : FxIndexSet :: default ( ) }
21
21
}
22
22
}
23
23
@@ -79,7 +79,7 @@ fn environment<'tcx>(
79
79
} ;
80
80
81
81
// FIXME(eddyb) isn't the unordered nature of this a hazard?
82
- let mut inputs = FxHashSet :: default ( ) ;
82
+ let mut inputs = FxIndexSet :: default ( ) ;
83
83
84
84
match node_kind {
85
85
// In a trait impl, we assume that the header trait ref and all its
@@ -140,7 +140,8 @@ fn in_environment(
140
140
None if obligation. param_env . caller_bounds . is_empty ( ) => ty:: List :: empty ( ) ,
141
141
// FIXME(chalk): this is hit in ui/where-clauses/where-clause-constraints-are-local-for-trait-impl
142
142
// and ui/generics/generic-static-methods
143
- _ => bug ! ( "non-empty `ParamEnv` with no def-id" ) ,
143
+ //_ => bug!("non-empty `ParamEnv` with no def-id"),
144
+ _ => ty:: List :: empty ( ) ,
144
145
} ;
145
146
146
147
ChalkEnvironmentAndGoal { environment, goal : obligation. predicate }
@@ -195,15 +196,15 @@ impl TraitEngine<'tcx> for FulfillmentContext<'tcx> {
195
196
infcx : & InferCtxt < ' _ , ' tcx > ,
196
197
) -> Result < ( ) , Vec < FulfillmentError < ' tcx > > > {
197
198
let mut errors = Vec :: new ( ) ;
198
- let mut next_round = FxHashSet :: default ( ) ;
199
+ let mut next_round = FxIndexSet :: default ( ) ;
199
200
let mut making_progress;
200
201
201
202
loop {
202
203
making_progress = false ;
203
204
204
205
// We iterate over all obligations, and record if we are able
205
206
// to unambiguously prove at least one obligation.
206
- for obligation in self . obligations . drain ( ) {
207
+ for obligation in self . obligations . drain ( .. ) {
207
208
let goal_in_environment = in_environment ( infcx, & obligation) ;
208
209
let mut orig_values = OriginalQueryValues :: default ( ) ;
209
210
let canonical_goal =
0 commit comments