diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2022-07-22 16:48:36 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-10-01 16:12:50 +0200 |
| commit | 3cb1811e459d1cf30dcb553ab99ce090cd5c76f1 (patch) | |
| tree | ba405b86869d065cae3b192f5197f452bf38c1ca /compiler/rustc_errors | |
| parent | 6019cbbfd3121d294c4705528ee66642e31ccf79 (diff) | |
| download | rust-3cb1811e459d1cf30dcb553ab99ce090cd5c76f1.tar.gz rust-3cb1811e459d1cf30dcb553ab99ce090cd5c76f1.zip | |
Compute `lint_levels` by definition
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 49dcc2ba021..31e410aaaf0 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -364,9 +364,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 c8711ec6e25..7c312da6279 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -1211,7 +1211,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(_)) |
