From 9d45c1e1d4fdd26749e602ef4771845f7dcb48b6 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 13 Mar 2026 12:31:51 +0100 Subject: [PATCH] Rename `LintContext::opt_span_diag_lint` method into `opt_span_lint` --- compiler/rustc_lint/src/context.rs | 10 +++++----- compiler/rustc_lint/src/early.rs | 4 ++-- compiler/rustc_lint/src/levels.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs index da28c63c9f28..752c2220d414 100644 --- a/compiler/rustc_lint/src/context.rs +++ b/compiler/rustc_lint/src/context.rs @@ -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>( + fn opt_span_lint>( &self, lint: &'static Lint, span: Option, @@ -532,7 +532,7 @@ fn emit_span_lint>( 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>( + fn opt_span_lint>( &self, lint: &'static Lint, span: Option, @@ -613,13 +613,13 @@ fn sess(&self) -> &Session { self.builder.sess() } - fn opt_span_diag_lint>( + fn opt_span_lint>( &self, lint: &'static Lint, span: Option, 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 { diff --git a/compiler/rustc_lint/src/early.rs b/compiler/rustc_lint/src/early.rs index 92232c7d230b..c0eca3b5197b 100644 --- a/compiler/rustc_lint/src/early.rs +++ b/compiler/rustc_lint/src/early.rs @@ -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); } } } diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs index 5536bfc0176a..2b859b65c9f8 100644 --- a/compiler/rustc_lint/src/levels.rs +++ b/compiler/rustc_lint/src/levels.rs @@ -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,