Address review nitpicks.

This commit is contained in:
jumbatm 2020-02-06 01:28:23 +10:00
parent 0b2436f3a4
commit 284982df60
2 changed files with 4 additions and 4 deletions
src/librustc_lint

View File

@ -474,10 +474,10 @@ pub trait LintContext: Sized {
fn sess(&self) -> &Session;
fn lints(&self) -> &LintStore;
fn lookup_with_diagnostics<S: Into<MultiSpan>>(
fn lookup_with_diagnostics(
&self,
lint: &'static Lint,
span: Option<S>,
span: Option<impl Into<MultiSpan>>,
decorate: impl for<'a> FnOnce(LintDiagnosticBuilder<'a>),
diagnostic: BuiltinLintDiagnostics,
) {

View File

@ -41,11 +41,11 @@ impl<'a, T: EarlyLintPass> EarlyContextAndPass<'a, T> {
span,
msg,
node_id: _,
lint_id: _,
lint_id,
diagnostic,
} = early_lint;
self.context.lookup_with_diagnostics(
early_lint.lint_id.lint,
lint_id.lint,
Some(span),
|lint| lint.build(&msg).emit(),
diagnostic,