Skip to content

Commit

Permalink
Return FxIndexSet instead of FxHashSet to avoid order errors on diffe…
Browse files Browse the repository at this point in the history
…rent platforms
  • Loading branch information
spastorino committed Nov 27, 2020
1 parent 504d27c commit ada7c1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_infer/src/traits/util.rs
@@ -1,7 +1,7 @@
use smallvec::smallvec;

use crate::traits::{Obligation, ObligationCause, PredicateObligation};
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
use rustc_middle::ty::outlives::Component;
use rustc_middle::ty::{self, ToPredicate, TyCtxt, WithConstness};
use rustc_span::symbol::Ident;
Expand Down Expand Up @@ -297,9 +297,9 @@ pub fn transitive_bounds_that_define_assoc_type<'tcx>(
tcx: TyCtxt<'tcx>,
bounds: impl Iterator<Item = ty::PolyTraitRef<'tcx>>,
assoc_name: Ident,
) -> FxHashSet<ty::PolyTraitRef<'tcx>> {
) -> FxIndexSet<ty::PolyTraitRef<'tcx>> {
let mut stack: Vec<_> = bounds.collect();
let mut trait_refs = FxHashSet::default();
let mut trait_refs = FxIndexSet::default();

while let Some(trait_ref) = stack.pop() {
if trait_refs.insert(trait_ref) {
Expand Down

0 comments on commit ada7c1f

Please sign in to comment.