lint: port expectation diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
2a69640eb2
commit
a0624eb6c9
2 changed files with 6 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
use crate::builtin;
|
||||
use rustc_errors::fluent;
|
||||
use rustc_hir::HirId;
|
||||
use rustc_middle::ty::query::Providers;
|
||||
use rustc_middle::{lint::LintExpectation, ty::TyCtxt};
|
||||
|
@ -43,13 +44,13 @@ fn emit_unfulfilled_expectation_lint(
|
|||
hir_id,
|
||||
expectation.emission_span,
|
||||
|diag| {
|
||||
let mut diag = diag.build("this lint expectation is unfulfilled");
|
||||
let mut diag = diag.build(fluent::lint::expectation);
|
||||
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.note(fluent::lint::note);
|
||||
}
|
||||
|
||||
diag.emit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue