about summary refs log tree commit diff
path: root/compiler/rustc_errors
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2022-07-22 16:48:36 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2022-09-14 19:02:44 +0200
commiteb19a8a6208d992d6d4e661be8fa80c1eeab01f6 (patch)
tree61095efad35d8de4b0096fb90dfa234c7d19f192 /compiler/rustc_errors
parentc97922dca563cb7f9385b18dbf7ca8c97f8e1597 (diff)
downloadrust-eb19a8a6208d992d6d4e661be8fa80c1eeab01f6.tar.gz
rust-eb19a8a6208d992d6d4e661be8fa80c1eeab01f6.zip
Compute `lint_levels` by definition
Diffstat (limited to 'compiler/rustc_errors')
-rw-r--r--compiler/rustc_errors/src/diagnostic.rs5
-rw-r--r--compiler/rustc_errors/src/lib.rs2
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs
index a774b52c8a5..6dfb6b11b16 100644
--- a/compiler/rustc_errors/src/diagnostic.rs
+++ b/compiler/rustc_errors/src/diagnostic.rs
@@ -338,9 +338,10 @@ impl Diagnostic {
             // The lint index inside the attribute is manually transferred here.
             let lint_index = expectation_id.get_lint_index();
             expectation_id.set_lint_index(None);
-            let mut stable_id = *unstable_to_stable
+            let mut stable_id = unstable_to_stable
                 .get(&expectation_id)
-                .expect("each unstable `LintExpectationId` must have a matching stable id");
+                .expect("each unstable `LintExpectationId` must have a matching stable id")
+                .normalize();
 
             stable_id.set_lint_index(lint_index);
             *expectation_id = stable_id;
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 888128f3f74..1b24f07e689 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -1167,7 +1167,7 @@ impl HandlerInner {
 
         if let Some(expectation_id) = diagnostic.level.get_expectation_id() {
             self.suppressed_expected_diag = true;
-            self.fulfilled_expectations.insert(expectation_id);
+            self.fulfilled_expectations.insert(expectation_id.normalize());
         }
 
         if matches!(diagnostic.level, Warning(_))