Skip to content

Commit 9d45c1e

Browse files
Rename LintContext::opt_span_diag_lint method into opt_span_lint
1 parent a280f54 commit 9d45c1e

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

compiler/rustc_lint/src/context.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ pub trait LintContext {
516516
///
517517
/// [`emit_lint_base`]: rustc_middle::lint::emit_lint_base#decorate-signature
518518
#[track_caller]
519-
fn opt_span_diag_lint<S: Into<MultiSpan>>(
519+
fn opt_span_lint<S: Into<MultiSpan>>(
520520
&self,
521521
lint: &'static Lint,
522522
span: Option<S>,
@@ -532,7 +532,7 @@ pub trait LintContext {
532532
span: S,
533533
decorator: impl for<'a> Diagnostic<'a, ()>,
534534
) {
535-
self.opt_span_diag_lint(lint, Some(span), decorator);
535+
self.opt_span_lint(lint, Some(span), decorator);
536536
}
537537

538538
/// This returns the lint level for the given lint at the current location.
@@ -588,7 +588,7 @@ impl<'tcx> LintContext for LateContext<'tcx> {
588588
self.tcx.sess
589589
}
590590

591-
fn opt_span_diag_lint<S: Into<MultiSpan>>(
591+
fn opt_span_lint<S: Into<MultiSpan>>(
592592
&self,
593593
lint: &'static Lint,
594594
span: Option<S>,
@@ -613,13 +613,13 @@ impl LintContext for EarlyContext<'_> {
613613
self.builder.sess()
614614
}
615615

616-
fn opt_span_diag_lint<S: Into<MultiSpan>>(
616+
fn opt_span_lint<S: Into<MultiSpan>>(
617617
&self,
618618
lint: &'static Lint,
619619
span: Option<S>,
620620
decorator: impl for<'a> Diagnostic<'a, ()>,
621621
) {
622-
self.builder.opt_span_diag_lint(lint, span.map(|s| s.into()), decorator)
622+
self.builder.opt_span_lint(lint, span.map(|s| s.into()), decorator)
623623
}
624624

625625
fn get_lint_level(&self, lint: &'static Lint) -> LevelAndSource {

compiler/rustc_lint/src/early.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl<'ecx, 'tcx, T: EarlyLintPass> EarlyContextAndPass<'ecx, 'tcx, T> {
3939
let BufferedEarlyLint { span, node_id: _, lint_id, diagnostic } = early_lint;
4040
match diagnostic {
4141
DecorateDiagCompat::Builtin(b) => {
42-
self.context.opt_span_diag_lint(
42+
self.context.opt_span_lint(
4343
lint_id.lint,
4444
span,
4545
DecorateBuiltinLint {
@@ -50,7 +50,7 @@ impl<'ecx, 'tcx, T: EarlyLintPass> EarlyContextAndPass<'ecx, 'tcx, T> {
5050
);
5151
}
5252
DecorateDiagCompat::Dynamic(d) => {
53-
self.context.opt_span_diag_lint(lint_id.lint, span, d);
53+
self.context.opt_span_lint(lint_id.lint, span, d);
5454
}
5555
}
5656
}

compiler/rustc_lint/src/levels.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
10011001
/// Used to emit a lint-related diagnostic based on the current state of
10021002
/// this lint context.
10031003
#[track_caller]
1004-
pub(crate) fn opt_span_diag_lint(
1004+
pub(crate) fn opt_span_lint(
10051005
&self,
10061006
lint: &'static Lint,
10071007
span: Option<MultiSpan>,

0 commit comments

Comments
 (0)