Skip to content

Commit c81767e

Browse files
committed
Reorder has_future_breakage handling.
This will enable additional refactorings.
1 parent 272e60b commit c81767e

File tree

1 file changed

+8
-8
lines changed
  • compiler/rustc_errors/src

1 file changed

+8
-8
lines changed

compiler/rustc_errors/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,6 +1356,14 @@ impl DiagCtxtInner {
13561356
fn emit_diagnostic(&mut self, mut diagnostic: DiagInner) -> Option<ErrorGuaranteed> {
13571357
assert!(diagnostic.level.can_be_top_or_sub().0);
13581358

1359+
if diagnostic.has_future_breakage() {
1360+
// Future breakages aren't emitted if they're Level::Allow,
1361+
// but they still need to be constructed and stashed below,
1362+
// so they'll trigger the must_produce_diag check.
1363+
self.suppressed_expected_diag = true;
1364+
self.future_breakage_diagnostics.push(diagnostic.clone());
1365+
}
1366+
13591367
if let Expect(expect_id) | ForceWarning(Some(expect_id)) = diagnostic.level {
13601368
// The `LintExpectationId` can be stable or unstable depending on when it was created.
13611369
// Diagnostics created before the definition of `HirId`s are unstable and can not yet
@@ -1369,14 +1377,6 @@ impl DiagCtxtInner {
13691377
self.fulfilled_expectations.insert(expect_id.normalize());
13701378
}
13711379

1372-
if diagnostic.has_future_breakage() {
1373-
// Future breakages aren't emitted if they're Level::Allow,
1374-
// but they still need to be constructed and stashed below,
1375-
// so they'll trigger the must_produce_diag check.
1376-
self.suppressed_expected_diag = true;
1377-
self.future_breakage_diagnostics.push(diagnostic.clone());
1378-
}
1379-
13801380
match diagnostic.level {
13811381
Fatal | Error if self.treat_next_err_as_bug() => {
13821382
// `Fatal` and `Error` can be promoted to `Bug`.

0 commit comments

Comments
 (0)