From 5bbc240ffbb0dcf510fd73d71dae529bd345e6b2 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 15 May 2021 16:10:17 -0700 Subject: Fix unused attributes on macro_rules. --- compiler/rustc_lint/src/late.rs | 4 ++++ compiler/rustc_target/src/asm/mod.rs | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'compiler') diff --git a/compiler/rustc_lint/src/late.rs b/compiler/rustc_lint/src/late.rs index d325b5fe7f8..0a7ab4a2baf 100644 --- a/compiler/rustc_lint/src/late.rs +++ b/compiler/rustc_lint/src/late.rs @@ -448,6 +448,10 @@ fn late_lint_pass_crate<'tcx, T: LateLintPass<'tcx>>(tcx: TyCtxt<'tcx>, pass: T) lint_callback!(cx, check_crate, krate); hir_visit::walk_crate(cx, krate); + for attr in krate.non_exported_macro_attrs { + // This HIR ID is a lie, since the macro ID isn't available. + cx.visit_attribute(hir::CRATE_HIR_ID, attr); + } lint_callback!(cx, check_crate_post, krate); }) diff --git a/compiler/rustc_target/src/asm/mod.rs b/compiler/rustc_target/src/asm/mod.rs index f12debb5a34..f4e4579bec2 100644 --- a/compiler/rustc_target/src/asm/mod.rs +++ b/compiler/rustc_target/src/asm/mod.rs @@ -6,7 +6,6 @@ use rustc_span::Symbol; use std::fmt; use std::str::FromStr; -#[macro_use] macro_rules! def_reg_class { ($arch:ident $arch_regclass:ident { $( @@ -51,7 +50,6 @@ macro_rules! def_reg_class { } } -#[macro_use] macro_rules! def_regs { ($arch:ident $arch_reg:ident $arch_regclass:ident { $( @@ -129,7 +127,6 @@ macro_rules! def_regs { } } -#[macro_use] macro_rules! types { ( $(_ : $($ty:expr),+;)? -- cgit 1.4.1-3-g733a5