Rename DecorateLint
as LintDiagnostic
.
To match `derive(LintDiagnostic)`.
This commit is contained in:
parent
541d7cc65c
commit
e9f0d9be0e
16 changed files with 54 additions and 54 deletions
|
@ -1,8 +1,8 @@
|
|||
use std::borrow::Cow;
|
||||
|
||||
use rustc_errors::{
|
||||
codes::*, Applicability, DecorateLint, Diag, DiagArgValue, DiagCtxt, DiagMessage, Diagnostic,
|
||||
EmissionGuarantee, Level,
|
||||
codes::*, Applicability, Diag, DiagArgValue, DiagCtxt, DiagMessage, Diagnostic,
|
||||
EmissionGuarantee, Level, LintDiagnostic,
|
||||
};
|
||||
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
|
||||
use rustc_middle::mir::{AssertKind, UnsafetyViolationDetails};
|
||||
|
@ -181,7 +181,7 @@ pub(crate) struct UnsafeOpInUnsafeFn {
|
|||
pub suggest_unsafe_block: Option<(Span, Span, Span)>,
|
||||
}
|
||||
|
||||
impl<'a> DecorateLint<'a, ()> for UnsafeOpInUnsafeFn {
|
||||
impl<'a> LintDiagnostic<'a, ()> for UnsafeOpInUnsafeFn {
|
||||
#[track_caller]
|
||||
fn decorate_lint<'b>(self, diag: &'b mut Diag<'a, ()>) {
|
||||
let desc = diag.dcx.eagerly_translate_to_string(self.details.label(), [].into_iter());
|
||||
|
@ -215,7 +215,7 @@ pub(crate) enum AssertLintKind {
|
|||
UnconditionalPanic,
|
||||
}
|
||||
|
||||
impl<'a, P: std::fmt::Debug> DecorateLint<'a, ()> for AssertLint<P> {
|
||||
impl<'a, P: std::fmt::Debug> LintDiagnostic<'a, ()> for AssertLint<P> {
|
||||
fn decorate_lint<'b>(self, diag: &'b mut Diag<'a, ()>) {
|
||||
let message = self.assert_kind.diagnostic_message();
|
||||
self.assert_kind.add_args(&mut |name, value| {
|
||||
|
@ -269,7 +269,7 @@ pub(crate) struct MustNotSupend<'tcx, 'a> {
|
|||
}
|
||||
|
||||
// Needed for def_path_str
|
||||
impl<'a> DecorateLint<'a, ()> for MustNotSupend<'_, '_> {
|
||||
impl<'a> LintDiagnostic<'a, ()> for MustNotSupend<'_, '_> {
|
||||
fn decorate_lint<'b>(self, diag: &'b mut rustc_errors::Diag<'a, ()>) {
|
||||
diag.span_label(self.yield_sp, fluent::_subdiag::label);
|
||||
if let Some(reason) = self.reason {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue