Skip to content

Commit

Permalink
Fix fulldeps tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Mar 13, 2021
1 parent e281f67 commit f065656
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/test/ui-fulldeps/auxiliary/lint-group-plugin-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern crate rustc_lint;
extern crate rustc_session;

use rustc_driver::plugin::Registry;
use rustc_lint::{LateContext, LateLintPass, LintArray, LintContext, LintId, LintPass};
use rustc_lint::{LateContext, LateLintPass, LintContext, LintId};

declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'");

Expand All @@ -22,12 +22,13 @@ declare_lint_pass!(Pass => [TEST_LINT, PLEASE_LINT]);

impl<'tcx> LateLintPass<'tcx> for Pass {
fn check_item(&mut self, cx: &LateContext, it: &rustc_hir::Item) {
let it_span = cx.tcx.hir().span_with_body(it.hir_id());
match &*it.ident.as_str() {
"lintme" => cx.lint(TEST_LINT, |lint| {
lint.build("item is named 'lintme'").set_span(it.span).emit()
lint.build("item is named 'lintme'").set_span(it_span).emit()
}),
"pleaselintme" => cx.lint(PLEASE_LINT, |lint| {
lint.build("item is named 'pleaselintme'").set_span(it.span).emit()
lint.build("item is named 'pleaselintme'").set_span(it_span).emit()
}),
_ => {}
}
Expand Down

0 comments on commit f065656

Please sign in to comment.