@@ -4,7 +4,7 @@ use crate::errors::{
4
4
ParenthesizedFnTraitExpansion ,
5
5
} ;
6
6
use crate :: traits:: error_reporting:: report_object_safety_error;
7
- use rustc_data_structures:: fx:: FxHashMap ;
7
+ use rustc_data_structures:: fx:: { FxHashMap , FxIndexMap , FxIndexSet } ;
8
8
use rustc_errors:: { pluralize, struct_span_err, Applicability , Diagnostic , ErrorGuaranteed } ;
9
9
use rustc_hir as hir;
10
10
use rustc_hir:: def_id:: { DefId , LocalDefId } ;
@@ -16,8 +16,6 @@ use rustc_span::symbol::{sym, Ident};
16
16
use rustc_span:: { Span , Symbol , DUMMY_SP } ;
17
17
use rustc_trait_selection:: traits:: object_safety_violations_for_assoc_item;
18
18
19
- use std:: collections:: BTreeSet ;
20
-
21
19
impl < ' o , ' tcx > dyn AstConv < ' tcx > + ' o {
22
20
/// On missing type parameters, emit an E0393 error and provide a structured suggestion using
23
21
/// the type parameter's name as a placeholder.
@@ -504,7 +502,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
504
502
/// emit a generic note suggesting using a `where` clause to constraint instead.
505
503
pub ( crate ) fn complain_about_missing_associated_types (
506
504
& self ,
507
- associated_types : FxHashMap < Span , BTreeSet < DefId > > ,
505
+ associated_types : FxIndexMap < Span , FxIndexSet < DefId > > ,
508
506
potential_assoc_types : Vec < Span > ,
509
507
trait_bounds : & [ hir:: PolyTraitRef < ' _ > ] ,
510
508
) {
@@ -514,13 +512,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
514
512
let tcx = self . tcx ( ) ;
515
513
// FIXME: Marked `mut` so that we can replace the spans further below with a more
516
514
// 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
518
516
. into_iter ( )
519
517
. map ( |( span, def_ids) | {
520
518
( span, def_ids. into_iter ( ) . map ( |did| tcx. associated_item ( did) ) . collect ( ) )
521
519
} )
522
520
. collect ( ) ;
523
- let mut names: FxHashMap < String , Vec < Symbol > > = Default :: default ( ) ;
521
+ let mut names: FxIndexMap < String , Vec < Symbol > > = Default :: default ( ) ;
524
522
let mut names_len = 0 ;
525
523
526
524
// Account for things like `dyn Foo + 'a`, like in tests `issue-22434.rs` and
0 commit comments