@@ -522,6 +522,11 @@ impl Drop for HandlerInner {
522
522
"no warnings or errors encountered even though `delayed_good_path_bugs` issued" ,
523
523
) ;
524
524
}
525
+
526
+ assert ! (
527
+ self . unstable_expect_diagnostics. is_empty( ) ,
528
+ "all diagnostics with unstable expectations should have been converted" ,
529
+ ) ;
525
530
}
526
531
}
527
532
@@ -942,25 +947,25 @@ impl Handler {
942
947
943
948
let mut inner = self . inner . borrow_mut ( ) ;
944
949
for mut diag in diags. into_iter ( ) {
945
- let mut unstable_id = diag
950
+ diag. update_unstable_expectation_id ( unstable_to_stable) ;
951
+
952
+ let stable_id = diag
946
953
. level
947
954
. get_expectation_id ( )
948
955
. expect ( "all diagnostics inside `unstable_expect_diagnostics` must have a `LintExpectationId`" ) ;
949
-
950
- // The unstable to stable map only maps the unstable `AttrId` to a stable `HirId` with an attribute index.
951
- // The lint index inside the attribute is manually transferred here.
952
- let lint_index = unstable_id. get_lint_index ( ) ;
953
- unstable_id. set_lint_index ( None ) ;
954
- let mut stable_id = * unstable_to_stable
955
- . get ( & unstable_id)
956
- . expect ( "each unstable `LintExpectationId` must have a matching stable id" ) ;
957
-
958
- stable_id. set_lint_index ( lint_index) ;
959
- diag. level = Level :: Expect ( stable_id) ;
960
956
inner. fulfilled_expectations . insert ( stable_id) ;
961
957
962
958
( * TRACK_DIAGNOSTICS ) ( & diag) ;
963
959
}
960
+
961
+ inner
962
+ . stashed_diagnostics
963
+ . values_mut ( )
964
+ . for_each ( |diag| diag. update_unstable_expectation_id ( unstable_to_stable) ) ;
965
+ inner
966
+ . future_breakage_diagnostics
967
+ . iter_mut ( )
968
+ . for_each ( |diag| diag. update_unstable_expectation_id ( unstable_to_stable) ) ;
964
969
}
965
970
966
971
/// This methods steals all [`LintExpectationId`]s that are stored inside
0 commit comments