@@ -4,7 +4,7 @@ use crate::errors::{
44 ParenthesizedFnTraitExpansion ,
55} ;
66use crate :: traits:: error_reporting:: report_object_safety_error;
7- use rustc_data_structures:: fx:: FxHashMap ;
7+ use rustc_data_structures:: fx:: { FxHashMap , FxIndexMap , FxIndexSet } ;
88use rustc_errors:: { pluralize, struct_span_err, Applicability , Diagnostic , ErrorGuaranteed } ;
99use rustc_hir as hir;
1010use rustc_hir:: def_id:: { DefId , LocalDefId } ;
@@ -16,8 +16,6 @@ use rustc_span::symbol::{sym, Ident};
1616use rustc_span:: { Span , Symbol , DUMMY_SP } ;
1717use rustc_trait_selection:: traits:: object_safety_violations_for_assoc_item;
1818
19- use std:: collections:: BTreeSet ;
20-
2119impl < ' o , ' tcx > dyn AstConv < ' tcx > + ' o {
2220 /// On missing type parameters, emit an E0393 error and provide a structured suggestion using
2321 /// the type parameter's name as a placeholder.
@@ -504,7 +502,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
504502 /// emit a generic note suggesting using a `where` clause to constraint instead.
505503 pub ( crate ) fn complain_about_missing_associated_types (
506504 & self ,
507- associated_types : FxHashMap < Span , BTreeSet < DefId > > ,
505+ associated_types : FxIndexMap < Span , FxIndexSet < DefId > > ,
508506 potential_assoc_types : Vec < Span > ,
509507 trait_bounds : & [ hir:: PolyTraitRef < ' _ > ] ,
510508 ) {
@@ -514,13 +512,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
514512 let tcx = self . tcx ( ) ;
515513 // FIXME: Marked `mut` so that we can replace the spans further below with a more
516514 // appropriate one, but this should be handled earlier in the span assignment.
517- let mut associated_types: FxHashMap < Span , Vec < _ > > = associated_types
515+ let mut associated_types: FxIndexMap < Span , Vec < _ > > = associated_types
518516 . into_iter ( )
519517 . map ( |( span, def_ids) | {
520518 ( span, def_ids. into_iter ( ) . map ( |did| tcx. associated_item ( did) ) . collect ( ) )
521519 } )
522520 . collect ( ) ;
523- let mut names: FxHashMap < String , Vec < Symbol > > = Default :: default ( ) ;
521+ let mut names: FxIndexMap < String , Vec < Symbol > > = Default :: default ( ) ;
524522 let mut names_len = 0 ;
525523
526524 // Account for things like `dyn Foo + 'a`, like in tests `issue-22434.rs` and
0 commit comments