Skip to content

Commit

Permalink
Tweak test.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongmao86 committed Feb 9, 2020
1 parent b3a82d6 commit cd0ba7c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/ui/collapsible_span_lint_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use rustc_lint::{EarlyContext, EarlyLintPass, LintContext, Lint};
use syntax::ast::Expr;
use rustc_span::source_map::Span;

#[allow(unused_variables)]
pub fn span_lint_and_then<'a, T: LintContext, F>(cx: &'a T, lint: &'static Lint, sp: Span, msg: &str, f: F)
where
F: for<'b> FnOnce(&mut DiagnosticBuilder<'b>),
Expand All @@ -35,6 +36,7 @@ impl EarlyLintPass for Pass {
let help_msg = "help message";
let note_msg = "note message";
let sugg = "new_call()";

span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
db.span_suggestion(expr.span, help_msg, sugg.to_string(), Applicability::MachineApplicable);
});
Expand Down

0 comments on commit cd0ba7c

Please sign in to comment.