Rename LintContext::lookup_with_diagnostics as LintContext::span_lint_with_diagnostics.

This commit is contained in:
Nicholas Nethercote 2024-01-16 14:34:58 +11:00
parent 2de5242ea6
commit c915e90f7e
3 changed files with 9 additions and 3 deletions

View File

@ -2849,7 +2849,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) {
let target_spans: MultiSpan =
if spans.len() > 0 { spans.into() } else { (*template_span).into() };
cx.lookup_with_diagnostics(
cx.span_lint_with_diagnostics(
NAMED_ASM_LABELS,
Some(target_spans),
fluent::lint_builtin_asm_labels,

View File

@ -532,7 +532,7 @@ pub trait LintContext {
///
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
#[rustc_lint_diagnostics]
fn lookup_with_diagnostics(
fn span_lint_with_diagnostics(
&self,
lint: &'static Lint,
span: Option<impl Into<MultiSpan>>,

View File

@ -45,7 +45,13 @@ impl<'a, T: EarlyLintPass> EarlyContextAndPass<'a, T> {
fn inlined_check_id(&mut self, id: ast::NodeId) {
for early_lint in self.context.buffered.take(id) {
let BufferedEarlyLint { span, msg, node_id: _, lint_id, diagnostic } = early_lint;
self.context.lookup_with_diagnostics(lint_id.lint, Some(span), msg, |_| {}, diagnostic);
self.context.span_lint_with_diagnostics(
lint_id.lint,
Some(span),
msg,
|_| {},
diagnostic,
);
}
}