summaryrefslogtreecommitdiffstats
path: root/src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs b/src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs
index 03ad3ca82..c05443488 100644
--- a/src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs
+++ b/src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs
@@ -44,14 +44,16 @@ impl<'tcx> LateLintPass<'tcx> for MissingAllowedAttrPass {
) {
let item = match cx.tcx.hir().get(id) {
Node::Item(item) => item,
- _ => cx.tcx.hir().expect_item(cx.tcx.hir().get_parent_item(id)),
+ _ => cx.tcx.hir().expect_item(cx.tcx.hir().get_parent_item(id).def_id),
};
let allowed = |attr| pprust::attribute_to_string(attr).contains("allowed_attr");
if !cx.tcx.hir().attrs(item.hir_id()).iter().any(allowed) {
- cx.lint(MISSING_ALLOWED_ATTR, |lint| {
- lint.build("Missing 'allowed_attr' attribute").set_span(span).emit();
- });
+ cx.lint(
+ MISSING_ALLOWED_ATTR,
+ "Missing 'allowed_attr' attribute",
+ |lint| lint.set_span(span)
+ );
}
}
}