From 794295b3f6ceea721c87c09af91e5f47d52c228f Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Tue, 12 Nov 2019 00:56:48 +0100 Subject: [PATCH] Helper attributes in attribute macros This little gotcha took me a while to figure out, maybe others will benefit from this addition swell --- src/procedural-macros.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/procedural-macros.md b/src/procedural-macros.md index 2bd3706a2..d6ae363d6 100644 --- a/src/procedural-macros.md +++ b/src/procedural-macros.md @@ -273,6 +273,11 @@ fn invoke4() {} // out: item: "fn invoke4() {}" ``` +#### Attribute macro helper attributes + +Unlike for [Derive macros] helper attributes do not have to be marked explicitly. +Since attribute macros can completely discard the input token stream filtering out custom `helper` attributes is entirely the job of the attribute macro. + [Attribute macros]: #attribute-macros [Cargo's build scripts]: ../cargo/reference/build-scripts.html [Derive macros]: #derive-macros