@@ -7,17 +7,17 @@ use crate::traits::{
77 ChalkEnvironmentAndGoal , ChalkEnvironmentClause , FulfillmentError , FulfillmentErrorCode ,
88 ObligationCause , PredicateObligation , SelectionError , TraitEngine ,
99} ;
10- use rustc_data_structures:: fx:: FxHashSet ;
10+ use rustc_data_structures:: fx:: FxIndexSet ;
1111use rustc_hir:: def_id:: DefId ;
1212use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
1313
1414pub struct FulfillmentContext < ' tcx > {
15- obligations : FxHashSet < PredicateObligation < ' tcx > > ,
15+ obligations : FxIndexSet < PredicateObligation < ' tcx > > ,
1616}
1717
1818impl FulfillmentContext < ' tcx > {
1919 crate fn new ( ) -> Self {
20- FulfillmentContext { obligations : FxHashSet :: default ( ) }
20+ FulfillmentContext { obligations : FxIndexSet :: default ( ) }
2121 }
2222}
2323
@@ -79,7 +79,7 @@ fn environment<'tcx>(
7979 } ;
8080
8181 // FIXME(eddyb) isn't the unordered nature of this a hazard?
82- let mut inputs = FxHashSet :: default ( ) ;
82+ let mut inputs = FxIndexSet :: default ( ) ;
8383
8484 match node_kind {
8585 // In a trait impl, we assume that the header trait ref and all its
@@ -140,7 +140,8 @@ fn in_environment(
140140 None if obligation. param_env . caller_bounds . is_empty ( ) => ty:: List :: empty ( ) ,
141141 // FIXME(chalk): this is hit in ui/where-clauses/where-clause-constraints-are-local-for-trait-impl
142142 // 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 ( ) ,
144145 } ;
145146
146147 ChalkEnvironmentAndGoal { environment, goal : obligation. predicate }
@@ -195,15 +196,15 @@ impl TraitEngine<'tcx> for FulfillmentContext<'tcx> {
195196 infcx : & InferCtxt < ' _ , ' tcx > ,
196197 ) -> Result < ( ) , Vec < FulfillmentError < ' tcx > > > {
197198 let mut errors = Vec :: new ( ) ;
198- let mut next_round = FxHashSet :: default ( ) ;
199+ let mut next_round = FxIndexSet :: default ( ) ;
199200 let mut making_progress;
200201
201202 loop {
202203 making_progress = false ;
203204
204205 // We iterate over all obligations, and record if we are able
205206 // to unambiguously prove at least one obligation.
206- for obligation in self . obligations . drain ( ) {
207+ for obligation in self . obligations . drain ( .. ) {
207208 let goal_in_environment = in_environment ( infcx, & obligation) ;
208209 let mut orig_values = OriginalQueryValues :: default ( ) ;
209210 let canonical_goal =
0 commit comments