resolve: Fix incorrect results of opt_def_kind query for some built-in macros

Previously it always returned `MacroKind::Bang` while some of those macros are actually attributes and derives
This commit is contained in:
Vadim Petrochenkov 2021-12-11 19:52:23 +08:00
parent e390e6c469
commit 83d32701f2

View file

@ -373,7 +373,7 @@ fn print_item(cx: &LateContext<'_>, item: &hir::Item<'_>) {
let item_ty = cx.tcx.type_of(did);
println!("function of type {:#?}", item_ty);
},
hir::ItemKind::Macro(ref macro_def) => {
hir::ItemKind::Macro(ref macro_def, _) => {
if macro_def.macro_rules {
println!("macro introduced by `macro_rules!`");
} else {