@@ -96,7 +96,7 @@ type MigrationNeededForCapture = (Option<hir::HirId>, String, String);
9696
9797/// Intermediate format to store the hir id of the root variable and a HashSet containing
9898/// information on why the root variable should be fully captured
99- type MigrationDiagnosticInfo = ( hir:: HirId , FxHashSet < MigrationNeededForCapture > ) ;
99+ type MigrationDiagnosticInfo = ( hir:: HirId , Vec < MigrationNeededForCapture > ) ;
100100
101101struct InferBorrowKindVisitor < ' a , ' tcx > {
102102 fcx : & ' a FnCtxt < ' a , ' tcx > ,
@@ -861,7 +861,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
861861
862862 // Perform auto-trait analysis
863863 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 ( ) ;
865865
866866 let auto_trait_diagnostic = if let Some ( diagnostics_info) =
867867 self . compute_2229_migrations_for_trait ( min_captures, var_hir_id, closure_clause)
@@ -891,6 +891,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
891891 capture_diagnostic. insert ( key. clone ( ) ) ;
892892 }
893893
894+ let mut capture_diagnostic = capture_diagnostic. into_iter ( ) . collect :: < Vec < _ > > ( ) ;
895+ capture_diagnostic. sort ( ) ;
894896 for captured_info in capture_diagnostic. iter ( ) {
895897 // Get the auto trait reasons of why migration is needed because of that capture, if there are any
896898 let capture_trait_reasons =
@@ -907,7 +909,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
907909 // auto trait implementation issues
908910 auto_trait_migration_reasons. extend ( capture_trait_reasons. clone ( ) ) ;
909911
910- responsible_captured_hir_ids. insert ( (
912+ responsible_captured_hir_ids. push ( (
911913 captured_info. 0 ,
912914 captured_info. 1 . clone ( ) ,
913915 self . compute_2229_migrations_reasons (
0 commit comments