1
Fork 0

Rename DecorateLint as LintDiagnostic.

To match `derive(LintDiagnostic)`.
This commit is contained in:
Nicholas Nethercote 2024-03-08 12:03:51 +11:00
parent 541d7cc65c
commit e9f0d9be0e
16 changed files with 54 additions and 54 deletions

View file

@ -43,7 +43,7 @@ use rustc_data_structures::sync::{self, FreezeReadGuard, Lock, Lrc, WorkerLocal}
#[cfg(parallel_compiler)]
use rustc_data_structures::sync::{DynSend, DynSync};
use rustc_data_structures::unord::UnordSet;
use rustc_errors::{DecorateLint, Diag, DiagCtxt, DiagMessage, ErrorGuaranteed, MultiSpan};
use rustc_errors::{Diag, DiagCtxt, DiagMessage, ErrorGuaranteed, LintDiagnostic, MultiSpan};
use rustc_hir as hir;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
@ -2129,7 +2129,7 @@ impl<'tcx> TyCtxt<'tcx> {
T::collect_and_apply(iter, |xs| self.mk_bound_variable_kinds(xs))
}
/// Emit a lint at `span` from a lint struct (some type that implements `DecorateLint`,
/// Emit a lint at `span` from a lint struct (some type that implements `LintDiagnostic`,
/// typically generated by `#[derive(LintDiagnostic)]`).
#[track_caller]
pub fn emit_node_span_lint(
@ -2137,7 +2137,7 @@ impl<'tcx> TyCtxt<'tcx> {
lint: &'static Lint,
hir_id: HirId,
span: impl Into<MultiSpan>,
decorator: impl for<'a> DecorateLint<'a, ()>,
decorator: impl for<'a> LintDiagnostic<'a, ()>,
) {
let msg = decorator.msg();
let (level, src) = self.lint_level_at_node(lint, hir_id);
@ -2163,14 +2163,14 @@ impl<'tcx> TyCtxt<'tcx> {
lint_level(self.sess, lint, level, src, Some(span.into()), msg, decorate);
}
/// Emit a lint from a lint struct (some type that implements `DecorateLint`, typically
/// Emit a lint from a lint struct (some type that implements `LintDiagnostic`, typically
/// generated by `#[derive(LintDiagnostic)]`).
#[track_caller]
pub fn emit_node_lint(
self,
lint: &'static Lint,
id: HirId,
decorator: impl for<'a> DecorateLint<'a, ()>,
decorator: impl for<'a> LintDiagnostic<'a, ()>,
) {
self.node_lint(lint, id, decorator.msg(), |diag| {
decorator.decorate_lint(diag);