about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-01-16 14:32:02 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-01-23 07:59:45 +1100
commit2de5242ea651d57c6496c720e12fdf8b2fa6f2c1 (patch)
treedac3d26b676e06c3d98f40557cc0eb7bd4a8b7d0
parentc56d71f418778a6957d01f54086592b0eb38b170 (diff)
downloadrust-2de5242ea651d57c6496c720e12fdf8b2fa6f2c1.tar.gz
rust-2de5242ea651d57c6496c720e12fdf8b2fa6f2c1.zip
Rename `LintContext::lookup` as `LintContext::opt_span_lint`.
-rw-r--r--compiler/rustc_lint/src/context.rs16
-rw-r--r--compiler/rustc_middle/src/lint.rs2
2 files changed, 9 insertions, 9 deletions
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<S: Into<MultiSpan>>(
+    fn opt_span_lint<S: Into<MultiSpan>>(
         &self,
         lint: &'static Lint,
         span: Option<S>,
@@ -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<DiagnosticMessage>,
         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<Span>, decorator.msg(), |diag| {
+        self.opt_span_lint(lint, None as Option<Span>, decorator.msg(), |diag| {
             decorator.decorate_lint(diag);
         });
     }
@@ -608,7 +608,7 @@ pub trait LintContext {
         msg: impl Into<DiagnosticMessage>,
         decorate: impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>),
     ) {
-        self.lookup(lint, None as Option<Span>, msg, decorate);
+        self.opt_span_lint(lint, None as Option<Span>, 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<S: Into<MultiSpan>>(
+    fn opt_span_lint<S: Into<MultiSpan>>(
         &self,
         lint: &'static Lint,
         span: Option<S>,
@@ -693,7 +693,7 @@ impl LintContext for EarlyContext<'_> {
     }
 
     #[rustc_lint_diagnostics]
-    fn lookup<S: Into<MultiSpan>>(
+    fn opt_span_lint<S: Into<MultiSpan>>(
         &self,
         lint: &'static Lint,
         span: Option<S>,
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`
 ///