about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/expect.rs
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2022-09-16 11:01:02 +0400
committerMaybe Waffle <waffle.lapkin@gmail.com>2022-10-01 10:03:06 +0000
commita8f7e244b785feb1b1d696abf0a7efb5cb7aed30 (patch)
tree494e24f05b9fe3dfe766207727a83d369c218c22 /compiler/rustc_lint/src/expect.rs
parent65445a571c11f07f4ca1ed0f63bad247ae295bd0 (diff)
downloadrust-a8f7e244b785feb1b1d696abf0a7efb5cb7aed30.tar.gz
rust-a8f7e244b785feb1b1d696abf0a7efb5cb7aed30.zip
Refactor rustc lint API
Diffstat (limited to 'compiler/rustc_lint/src/expect.rs')
-rw-r--r--compiler/rustc_lint/src/expect.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_lint/src/expect.rs b/compiler/rustc_lint/src/expect.rs
index 699e8154318..af13f453a50 100644
--- a/compiler/rustc_lint/src/expect.rs
+++ b/compiler/rustc_lint/src/expect.rs
@@ -43,17 +43,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::lint::note);
             }
 
-            diag.emit();
+            lint
         },
     );
 }