@@ -67,7 +67,7 @@ use crate::types::{
6767 BoundTypeVarIdentity , BoundTypeVarInstance , IntersectionType , Type , TypeRelation ,
6868 TypeVarBoundOrConstraints , UnionType , walk_bound_type_var_type,
6969} ;
70- use crate :: { Db , FxHashMap , FxHashSet , FxIndexSet , FxOrderSet } ;
70+ use crate :: { Db , FxHashMap , FxHashSet , FxOrderSet } ;
7171
7272/// An extension trait for building constraint sets from [`Option`] values.
7373pub ( crate ) trait OptionConstraintsExtension < T > {
@@ -1036,8 +1036,7 @@ impl<'db> Node<'db> {
10361036 Node :: Interior ( _) => { }
10371037 }
10381038
1039- // We should use `FxIndexSet` here since `BoundTypeVarInstance::{valid, required}_specializations` is query-dependent.
1040- let mut typevars = FxIndexSet :: default ( ) ;
1039+ let mut typevars = FxHashSet :: default ( ) ;
10411040 self . for_each_constraint ( db, & mut |constraint| {
10421041 typevars. insert ( constraint. typevar ( db) ) ;
10431042 } ) ;
@@ -1056,7 +1055,7 @@ impl<'db> Node<'db> {
10561055 . is_always_satisfied ( db)
10571056 } ;
10581057
1059- for typevar in typevars {
1058+ for typevar in typevars. unstable_iter ( ) {
10601059 if typevar. is_inferable ( db, inferable) {
10611060 // If the typevar is in inferable position, we need to verify that some valid
10621061 // specialization satisfies the constraint set.
@@ -1848,11 +1847,11 @@ impl<'db> InteriorNode<'db> {
18481847 // Seed the seen set with all of the constraints that are present in the input BDD, and the
18491848 // visit queue with all pairs of those constraints. (We use "combinations" because we don't
18501849 // need to compare a constraint against itself, and because ordering doesn't matter.)
1851- let mut seen_constraints = FxIndexSet :: default ( ) ;
1850+ let mut seen_constraints = FxHashSet :: default ( ) ;
18521851 Node :: Interior ( self ) . for_each_constraint ( db, & mut |constraint| {
18531852 seen_constraints. insert ( constraint) ;
18541853 } ) ;
1855- let mut to_visit: Vec < ( _ , _ ) > = ( seen_constraints. iter ( ) . copied ( ) )
1854+ let mut to_visit: Vec < ( _ , _ ) > = ( seen_constraints. unstable_iter ( ) . copied ( ) )
18561855 . tuple_combinations ( )
18571856 . collect ( ) ;
18581857
@@ -2011,7 +2010,7 @@ impl<'db> InteriorNode<'db> {
20112010 // seen set and (if we haven't already seen it) to the to-visit queue.
20122011 if seen_constraints. insert ( intersection_constraint) {
20132012 to_visit. extend (
2014- ( seen_constraints. iter ( ) . copied ( ) )
2013+ ( seen_constraints. unstable_iter ( ) . copied ( ) )
20152014 . filter ( |seen| * seen != intersection_constraint)
20162015 . map ( |seen| ( seen, intersection_constraint) ) ,
20172016 ) ;
0 commit comments