diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs index dca4d14f4bf..c96258b788e 100644 --- a/compiler/rustc_lint/src/context.rs +++ b/compiler/rustc_lint/src/context.rs @@ -541,7 +541,7 @@ pub trait LintContext { diagnostic: BuiltinLintDiagnostics, ) { // We first generate a blank diagnostic. - self.lookup(lint, span, msg, |db| { + self.opt_span_lint(lint, span, msg, |db| { // Now, set up surrounding context. diagnostics::builtin(self.sess(), diagnostic, db); // Rewrap `db`, and pass control to the user. @@ -555,7 +555,7 @@ pub trait LintContext { /// /// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature #[rustc_lint_diagnostics] - fn lookup>( + fn opt_span_lint>( &self, lint: &'static Lint, span: Option, @@ -571,7 +571,7 @@ pub trait LintContext { span: S, decorator: impl for<'a> DecorateLint<'a, ()>, ) { - self.lookup(lint, Some(span), decorator.msg(), |diag| { + self.opt_span_lint(lint, Some(span), decorator.msg(), |diag| { decorator.decorate_lint(diag); }); } @@ -587,13 +587,13 @@ pub trait LintContext { msg: impl Into, decorate: impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>), ) { - self.lookup(lint, Some(span), msg, decorate); + self.opt_span_lint(lint, Some(span), msg, decorate); } /// Emit a lint from a lint struct (some type that implements `DecorateLint`, typically /// generated by `#[derive(LintDiagnostic)]`). fn emit_lint(&self, lint: &'static Lint, decorator: impl for<'a> DecorateLint<'a, ()>) { - self.lookup(lint, None as Option, decorator.msg(), |diag| { + self.opt_span_lint(lint, None as Option, decorator.msg(), |diag| { decorator.decorate_lint(diag); }); } @@ -608,7 +608,7 @@ pub trait LintContext { msg: impl Into, decorate: impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>), ) { - self.lookup(lint, None as Option, msg, decorate); + self.opt_span_lint(lint, None as Option, msg, decorate); } /// This returns the lint level for the given lint at the current location. @@ -666,7 +666,7 @@ impl<'tcx> LintContext for LateContext<'tcx> { } #[rustc_lint_diagnostics] - fn lookup>( + fn opt_span_lint>( &self, lint: &'static Lint, span: Option, @@ -693,7 +693,7 @@ impl LintContext for EarlyContext<'_> { } #[rustc_lint_diagnostics] - fn lookup>( + fn opt_span_lint>( &self, lint: &'static Lint, span: Option, diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs index 4ab16cf19ba..7f1ac0ee815 100644 --- a/compiler/rustc_middle/src/lint.rs +++ b/compiler/rustc_middle/src/lint.rs @@ -251,7 +251,7 @@ pub fn explain_lint_level_source( /// - [`TyCtxt::struct_span_lint_hir`] /// - [`TyCtxt::emit_lint`] /// - [`TyCtxt::struct_lint_node`] -/// - `LintContext::lookup` +/// - `LintContext::opt_span_lint` /// /// ## `decorate` ///