Skip to content

Commit 9694929

Browse files
committed
imports removed DUMMY_HIR_IR into clippy.
1 parent c496f4e commit 9694929

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

clippy_lints/src/utils/author.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,21 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Author {
9393
}
9494

9595
fn check_variant(&mut self, cx: &LateContext<'a, 'tcx>, var: &'tcx hir::Variant<'_>) {
96+
use rustc_hir::def_id::{LocalDefId, CRATE_DEF_INDEX};
97+
use rustc_hir::{HirId, DUMMY_ITEM_LOCAL_ID};
98+
99+
const DUMMY_HIR_ID: HirId = HirId {
100+
owner: LocalDefId {
101+
local_def_index: CRATE_DEF_INDEX,
102+
},
103+
local_id: DUMMY_ITEM_LOCAL_ID,
104+
};
105+
96106
if !has_attr(cx.sess(), &var.attrs) {
97107
return;
98108
}
99109
prelude();
100-
PrintVisitor::new("var").visit_variant(var, &hir::Generics::empty(), hir::DUMMY_HIR_ID);
110+
PrintVisitor::new("var").visit_variant(var, &hir::Generics::empty(), DUMMY_HIR_ID);
101111
done();
102112
}
103113

0 commit comments

Comments
 (0)