@@ -4,7 +4,7 @@ use crate::infer::error_reporting::nice_region_error::NiceRegionError;
4
4
use crate :: infer:: lexical_region_resolve:: RegionResolutionError ;
5
5
use crate :: infer:: { SubregionOrigin , TypeTrace } ;
6
6
use crate :: traits:: { ObligationCauseCode , UnifyReceiverContext } ;
7
- use rustc_data_structures:: fx:: FxHashSet ;
7
+ use rustc_data_structures:: fx:: FxIndexSet ;
8
8
use rustc_errors:: { struct_span_err, Applicability , Diagnostic , ErrorGuaranteed , MultiSpan } ;
9
9
use rustc_hir:: def_id:: DefId ;
10
10
use rustc_hir:: intravisit:: { walk_ty, Visitor } ;
@@ -236,7 +236,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
236
236
// Same case of `impl Foo for dyn Bar { fn qux(&self) {} }` introducing a `'static`
237
237
// lifetime as above, but called using a fully-qualified path to the method:
238
238
// `Foo::qux(bar)`.
239
- let mut v = TraitObjectVisitor ( FxHashSet :: default ( ) ) ;
239
+ let mut v = TraitObjectVisitor ( FxIndexSet :: default ( ) ) ;
240
240
v. visit_ty ( param. param_ty ) ;
241
241
if let Some ( ( ident, self_ty) ) =
242
242
self . get_impl_ident_and_self_ty_from_trait ( item_def_id, & v. 0 )
@@ -408,7 +408,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
408
408
fn get_impl_ident_and_self_ty_from_trait (
409
409
& self ,
410
410
def_id : DefId ,
411
- trait_objects : & FxHashSet < DefId > ,
411
+ trait_objects : & FxIndexSet < DefId > ,
412
412
) -> Option < ( Ident , & ' tcx hir:: Ty < ' tcx > ) > {
413
413
let tcx = self . tcx ( ) ;
414
414
match tcx. hir ( ) . get_if_local ( def_id) {
@@ -490,7 +490,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
490
490
return false ;
491
491
} ;
492
492
493
- let mut v = TraitObjectVisitor ( FxHashSet :: default ( ) ) ;
493
+ let mut v = TraitObjectVisitor ( FxIndexSet :: default ( ) ) ;
494
494
v. visit_ty ( ty) ;
495
495
496
496
// Get the `Ident` of the method being called and the corresponding `impl` (to point at
@@ -506,7 +506,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
506
506
fn suggest_constrain_dyn_trait_in_impl (
507
507
& self ,
508
508
err : & mut Diagnostic ,
509
- found_dids : & FxHashSet < DefId > ,
509
+ found_dids : & FxIndexSet < DefId > ,
510
510
ident : Ident ,
511
511
self_ty : & hir:: Ty < ' _ > ,
512
512
) -> bool {
@@ -538,7 +538,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
538
538
}
539
539
540
540
/// Collect all the trait objects in a type that could have received an implicit `'static` lifetime.
541
- pub struct TraitObjectVisitor ( pub FxHashSet < DefId > ) ;
541
+ pub struct TraitObjectVisitor ( pub FxIndexSet < DefId > ) ;
542
542
543
543
impl < ' tcx > TypeVisitor < ' tcx > for TraitObjectVisitor {
544
544
fn visit_ty ( & mut self , t : Ty < ' tcx > ) -> ControlFlow < Self :: BreakTy > {
0 commit comments