]> git.lizzy.rs Git - rust.git/commitdiff
Hacky support for fn-like proc macros
authorJonas Schievink <jonasschievink@gmail.com>
Sat, 15 Aug 2020 13:34:56 +0000 (15:34 +0200)
committerJonas Schievink <jonasschievink@gmail.com>
Sat, 15 Aug 2020 13:34:56 +0000 (15:34 +0200)
crates/proc_macro_api/src/lib.rs

index 15db57eb28bb85badee87102ebfa2b7f0a5388d9..d5e87cf7d59cbf5c5453c2d4cf0da381714292aa 100644 (file)
@@ -89,9 +89,8 @@ pub fn by_dylib_path(&self, dylib_path: &Path) -> Vec<(SmolStr, Arc<dyn tt::Toke
                 macros
                     .into_iter()
                     .filter_map(|(name, kind)| {
-                        // FIXME: Support custom derive only for now.
                         match kind {
-                            ProcMacroKind::CustomDerive => {
+                            ProcMacroKind::CustomDerive | ProcMacroKind::FuncLike => {
                                 let name = SmolStr::new(&name);
                                 let expander: Arc<dyn tt::TokenExpander> =
                                     Arc::new(ProcMacroProcessExpander {
@@ -101,7 +100,8 @@ pub fn by_dylib_path(&self, dylib_path: &Path) -> Vec<(SmolStr, Arc<dyn tt::Toke
                                     });
                                 Some((name, expander))
                             }
-                            _ => None,
+                            // FIXME: Attribute macro are currently unsupported.
+                            ProcMacroKind::Attr => None,
                         }
                     })
                     .collect()