about summary refs log tree commit diff
path: root/src/libsyntax/ext/tt
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-03 04:22:44 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-03 23:57:35 +0300
commit2a9b75281bfb03fc795568ac8fb6eeff7cac8034 (patch)
treeea6822aaf109f50091b924dc173bb99b2c7a1425 /src/libsyntax/ext/tt
parenta45743345659c775b01484574af2818c46a2cb03 (diff)
downloadrust-2a9b75281bfb03fc795568ac8fb6eeff7cac8034.tar.gz
rust-2a9b75281bfb03fc795568ac8fb6eeff7cac8034.zip
Move special treatment of `derive(Copy, PartialEq, Eq)` from expansion infrastructure to elsewhere
Diffstat (limited to 'src/libsyntax/ext/tt')
-rw-r--r--src/libsyntax/ext/tt/macro_rules.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs
index ce695df7775..4ca2971dbbc 100644
--- a/src/libsyntax/ext/tt/macro_rules.rs
+++ b/src/libsyntax/ext/tt/macro_rules.rs
@@ -429,6 +429,8 @@ pub fn compile(
         }
     }
 
+    let is_builtin = attr::contains_name(&def.attrs, sym::rustc_builtin_macro);
+
     SyntaxExtension {
         kind: SyntaxExtensionKind::LegacyBang(expander),
         span: def.span,
@@ -440,7 +442,8 @@ pub fn compile(
         deprecation: attr::find_deprecation(&sess, &def.attrs, def.span),
         helper_attrs: Vec::new(),
         edition,
-        is_builtin: attr::contains_name(&def.attrs, sym::rustc_builtin_macro),
+        is_builtin,
+        is_derive_copy: is_builtin && def.ident.name == sym::Copy,
     }
 }