Rename LintContext::opt_span_diag_lint method into opt_span_lint

This commit is contained in:
Guillaume Gomez
2026-03-13 12:31:51 +01:00
parent a280f54264
commit 9d45c1e1d4
3 changed files with 8 additions and 8 deletions
+5 -5
View File
@@ -516,7 +516,7 @@ pub trait LintContext {
///
/// [`emit_lint_base`]: rustc_middle::lint::emit_lint_base#decorate-signature
#[track_caller]
fn opt_span_diag_lint<S: Into<MultiSpan>>(
fn opt_span_lint<S: Into<MultiSpan>>(
&self,
lint: &'static Lint,
span: Option<S>,
@@ -532,7 +532,7 @@ fn emit_span_lint<S: Into<MultiSpan>>(
span: S,
decorator: impl for<'a> Diagnostic<'a, ()>,
) {
self.opt_span_diag_lint(lint, Some(span), decorator);
self.opt_span_lint(lint, Some(span), decorator);
}
/// This returns the lint level for the given lint at the current location.
@@ -588,7 +588,7 @@ fn sess(&self) -> &Session {
self.tcx.sess
}
fn opt_span_diag_lint<S: Into<MultiSpan>>(
fn opt_span_lint<S: Into<MultiSpan>>(
&self,
lint: &'static Lint,
span: Option<S>,
@@ -613,13 +613,13 @@ fn sess(&self) -> &Session {
self.builder.sess()
}
fn opt_span_diag_lint<S: Into<MultiSpan>>(
fn opt_span_lint<S: Into<MultiSpan>>(
&self,
lint: &'static Lint,
span: Option<S>,
decorator: impl for<'a> Diagnostic<'a, ()>,
) {
self.builder.opt_span_diag_lint(lint, span.map(|s| s.into()), decorator)
self.builder.opt_span_lint(lint, span.map(|s| s.into()), decorator)
}
fn get_lint_level(&self, lint: &'static Lint) -> LevelAndSource {
+2 -2
View File
@@ -39,7 +39,7 @@ fn check_id(&mut self, id: ast::NodeId) {
let BufferedEarlyLint { span, node_id: _, lint_id, diagnostic } = early_lint;
match diagnostic {
DecorateDiagCompat::Builtin(b) => {
self.context.opt_span_diag_lint(
self.context.opt_span_lint(
lint_id.lint,
span,
DecorateBuiltinLint {
@@ -50,7 +50,7 @@ fn check_id(&mut self, id: ast::NodeId) {
);
}
DecorateDiagCompat::Dynamic(d) => {
self.context.opt_span_diag_lint(lint_id.lint, span, d);
self.context.opt_span_lint(lint_id.lint, span, d);
}
}
}
+1 -1
View File
@@ -1001,7 +1001,7 @@ pub fn lint_level(&self, lint: &'static Lint) -> LevelAndSource {
/// Used to emit a lint-related diagnostic based on the current state of
/// this lint context.
#[track_caller]
pub(crate) fn opt_span_diag_lint(
pub(crate) fn opt_span_lint(
&self,
lint: &'static Lint,
span: Option<MultiSpan>,