Skip to content

Commit f065656

Browse files
committed
Fix fulldeps tests.
1 parent e281f67 commit f065656

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/test/ui-fulldeps/auxiliary/lint-group-plugin-test.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern crate rustc_lint;
1212
extern crate rustc_session;
1313

1414
use rustc_driver::plugin::Registry;
15-
use rustc_lint::{LateContext, LateLintPass, LintArray, LintContext, LintId, LintPass};
15+
use rustc_lint::{LateContext, LateLintPass, LintContext, LintId};
1616

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

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

2323
impl<'tcx> LateLintPass<'tcx> for Pass {
2424
fn check_item(&mut self, cx: &LateContext, it: &rustc_hir::Item) {
25+
let it_span = cx.tcx.hir().span_with_body(it.hir_id());
2526
match &*it.ident.as_str() {
2627
"lintme" => cx.lint(TEST_LINT, |lint| {
27-
lint.build("item is named 'lintme'").set_span(it.span).emit()
28+
lint.build("item is named 'lintme'").set_span(it_span).emit()
2829
}),
2930
"pleaselintme" => cx.lint(PLEASE_LINT, |lint| {
30-
lint.build("item is named 'pleaselintme'").set_span(it.span).emit()
31+
lint.build("item is named 'pleaselintme'").set_span(it_span).emit()
3132
}),
3233
_ => {}
3334
}

0 commit comments

Comments
 (0)