Skip to content

Commit c8262ad

Browse files
Teach tools that macros are now HIR items
1 parent 8c4056f commit c8262ad

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

clippy_lints/src/missing_doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
122122
},
123123
hir::ItemKind::Const(..)
124124
| hir::ItemKind::Enum(..)
125-
| hir::ItemKind::Mod(..)
126125
| hir::ItemKind::Macro(..)
126+
| hir::ItemKind::Mod(..)
127127
| hir::ItemKind::Static(..)
128128
| hir::ItemKind::Struct(..)
129129
| hir::ItemKind::Trait(..)

clippy_lints/src/missing_inline.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingInline {
118118
},
119119
hir::ItemKind::Const(..)
120120
| hir::ItemKind::Enum(..)
121+
| hir::ItemKind::Macro(..)
121122
| hir::ItemKind::Mod(..)
122123
| hir::ItemKind::Static(..)
123124
| hir::ItemKind::Struct(..)

clippy_lints/src/utils/inspector.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,13 @@ fn print_item(cx: &LateContext<'_>, item: &hir::Item<'_>) {
381381
let item_ty = cx.tcx.type_of(did);
382382
println!("function of type {:#?}", item_ty);
383383
},
384+
hir::ItemKind::Macro(ref macro_def) => {
385+
if macro_def.macro_rules {
386+
println!("macro introduced by `macro_rules!`");
387+
} else {
388+
println!("macro introduced by `macro`");
389+
}
390+
},
384391
hir::ItemKind::Mod(..) => println!("module"),
385392
hir::ItemKind::ForeignMod { abi, .. } => println!("foreign module with abi: {}", abi),
386393
hir::ItemKind::GlobalAsm(asm) => println!("global asm: {:?}", asm),

0 commit comments

Comments
 (0)