Rename LintContext::lookup
as LintContext::opt_span_lint
.
This commit is contained in:
parent
c56d71f418
commit
2de5242ea6
@ -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>,
|
||||
|
@ -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`
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user