about summary refs log tree commit diff
path: root/compiler/rustc_passes/src
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2021-12-11 19:52:23 +0800
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2022-02-24 22:54:36 +0300
commit17b1afdbb234a1cdf5db92ec8639cbd2909ac629 (patch)
treefcb6280ad85de534ce8e37067300d5223d0ad0bc /compiler/rustc_passes/src
parent4b043faba34ccc053a4d0110634c323f6c03765e (diff)
downloadrust-17b1afdbb234a1cdf5db92ec8639cbd2909ac629.tar.gz
rust-17b1afdbb234a1cdf5db92ec8639cbd2909ac629.zip
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
Diffstat (limited to 'compiler/rustc_passes/src')
-rw-r--r--compiler/rustc_passes/src/check_attr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index 3d69e8ba4e4..b545961245a 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -1951,7 +1951,7 @@ impl<'tcx> Visitor<'tcx> for CheckAttrVisitor<'tcx> {
         // Historically we've run more checks on non-exported than exported macros,
         // so this lets us continue to run them while maintaining backwards compatibility.
         // In the long run, the checks should be harmonized.
-        if let ItemKind::Macro(ref macro_def) = item.kind {
+        if let ItemKind::Macro(ref macro_def, _) = item.kind {
             let def_id = item.def_id.to_def_id();
             if macro_def.macro_rules && !self.tcx.has_attr(def_id, sym::macro_export) {
                 check_non_exported_macro_for_invalid_attrs(self.tcx, item);