diff options
Diffstat (limited to '')
-rw-r--r-- | compiler/rustc_lint/src/expect.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler/rustc_lint/src/expect.rs b/compiler/rustc_lint/src/expect.rs index 699e81543..cf8f31bcb 100644 --- a/compiler/rustc_lint/src/expect.rs +++ b/compiler/rustc_lint/src/expect.rs @@ -16,8 +16,10 @@ fn check_expectations(tcx: TyCtxt<'_>, tool_filter: Option<Symbol>) { return; } + let lint_expectations = tcx.lint_expectations(()); let fulfilled_expectations = tcx.sess.diagnostic().steal_fulfilled_expectation_ids(); - let lint_expectations = &tcx.lint_levels(()).lint_expectations; + + tracing::debug!(?lint_expectations, ?fulfilled_expectations); for (id, expectation) in lint_expectations { // This check will always be true, since `lint_expectations` only @@ -43,17 +45,17 @@ fn emit_unfulfilled_expectation_lint( builtin::UNFULFILLED_LINT_EXPECTATIONS, hir_id, expectation.emission_span, - |diag| { - let mut diag = diag.build(fluent::lint::expectation); + fluent::lint_expectation, + |lint| { if let Some(rationale) = expectation.reason { - diag.note(rationale.as_str()); + lint.note(rationale.as_str()); } if expectation.is_unfulfilled_lint_expectations { - diag.note(fluent::lint::note); + lint.note(fluent::note); } - diag.emit(); + lint }, ); } |