From 64128ddbec3b812420b5687e9565675474535c9c Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Wed, 15 Nov 2023 00:48:21 +0000 Subject: [PATCH] Add `Target.is_proc_macro()` function --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 061fd8bc..3a122fd4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -577,6 +577,11 @@ impl Target { pub fn is_custom_build(&self) -> bool { self.is_kind("custom-build") } + + /// Return true if this target is of kind "proc-macro". + pub fn is_proc_macro(&self) -> bool { + self.is_kind("proc-macro") + } } /// The Rust edition