@@ -96,7 +96,7 @@ type MigrationNeededForCapture = (Option<hir::HirId>, String, String);
96
96
97
97
/// Intermediate format to store the hir id of the root variable and a HashSet containing
98
98
/// information on why the root variable should be fully captured
99
- type MigrationDiagnosticInfo = ( hir:: HirId , FxHashSet < MigrationNeededForCapture > ) ;
99
+ type MigrationDiagnosticInfo = ( hir:: HirId , Vec < MigrationNeededForCapture > ) ;
100
100
101
101
struct InferBorrowKindVisitor < ' a , ' tcx > {
102
102
fcx : & ' a FnCtxt < ' a , ' tcx > ,
@@ -861,7 +861,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
861
861
862
862
// Perform auto-trait analysis
863
863
for ( & var_hir_id, _) in upvars. iter ( ) {
864
- let mut responsible_captured_hir_ids = FxHashSet :: default ( ) ;
864
+ let mut responsible_captured_hir_ids = Vec :: new ( ) ;
865
865
866
866
let auto_trait_diagnostic = if let Some ( diagnostics_info) =
867
867
self . compute_2229_migrations_for_trait ( min_captures, var_hir_id, closure_clause)
@@ -891,6 +891,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
891
891
capture_diagnostic. insert ( key. clone ( ) ) ;
892
892
}
893
893
894
+ let mut capture_diagnostic = capture_diagnostic. into_iter ( ) . collect :: < Vec < _ > > ( ) ;
895
+ capture_diagnostic. sort ( ) ;
894
896
for captured_info in capture_diagnostic. iter ( ) {
895
897
// Get the auto trait reasons of why migration is needed because of that capture, if there are any
896
898
let capture_trait_reasons =
@@ -907,7 +909,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
907
909
// auto trait implementation issues
908
910
auto_trait_migration_reasons. extend ( capture_trait_reasons. clone ( ) ) ;
909
911
910
- responsible_captured_hir_ids. insert ( (
912
+ responsible_captured_hir_ids. push ( (
911
913
captured_info. 0 ,
912
914
captured_info. 1 . clone ( ) ,
913
915
self . compute_2229_migrations_reasons (
0 commit comments