diff options
| author | xFrednet <xFrednet@gmail.com> | 2022-03-06 14:18:28 +0100 |
|---|---|---|
| committer | xFrednet <xFrednet@gmail.com> | 2022-03-07 19:59:10 +0100 |
| commit | d39d60971bafe34f626585e4887e7eec726fe972 (patch) | |
| tree | fba3ce60fa91a7c38264eb4f42ad55beda12277c /compiler/rustc_lint/src/expect.rs | |
| parent | 165b5583e56ad6d54922a7b5117a37c2ca2c89a1 (diff) | |
| download | rust-d39d60971bafe34f626585e4887e7eec726fe972.tar.gz rust-d39d60971bafe34f626585e4887e7eec726fe972.zip | |
Handle `#[expect(unfulfilled_lint_expectations)]` with a lint message
Diffstat (limited to 'compiler/rustc_lint/src/expect.rs')
| -rw-r--r-- | compiler/rustc_lint/src/expect.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_lint/src/expect.rs b/compiler/rustc_lint/src/expect.rs index e6c9d0b0ab0..74fef0be9e9 100644 --- a/compiler/rustc_lint/src/expect.rs +++ b/compiler/rustc_lint/src/expect.rs @@ -30,10 +30,6 @@ fn emit_unfulfilled_expectation_lint( hir_id: HirId, expectation: &LintExpectation, ) { - // FIXME: The current implementation doesn't cover cases where the - // `unfulfilled_lint_expectations` is actually expected by another lint - // expectation. This can be added here by checking the lint level and - // retrieving the `LintExpectationId` if it was expected. tcx.struct_span_lint_hir( builtin::UNFULFILLED_LINT_EXPECTATIONS, hir_id, @@ -43,6 +39,11 @@ fn emit_unfulfilled_expectation_lint( if let Some(rationale) = expectation.reason { diag.note(&rationale.as_str()); } + + if expectation.is_unfulfilled_lint_expectations { + diag.note("the `unfulfilled_lint_expectations` lint can't be expected and will always produce this message"); + } + diag.emit(); }, ); |
