Skip to content

Commit 1f1fcfb

Browse files
committed
Add more comments about inert attributes
1 parent 3d1b9ae commit 1f1fcfb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/items/functions.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,13 @@ fn len(
268268
Inert helper attributes used by procedural macro attributes applied to items are also
269269
allowed but be careful to not include these inert attributes in your final `TokenStream`.
270270

271-
```rust
272-
#[hi_i_am_a_proc_macro_attribute]
273-
fn foo_oof(#[hello_i_am_an_inert_attribute] arg: u8) {
271+
For example, the following code defines an inert `some_inert_attribute` attribute that
272+
is not formally defined anywhere and the `some_proc_macro_attribute` procedural macro is
273+
responsible for detecting its presence and removing it from the output token stream.
274+
275+
```rust,ignore
276+
#[some_proc_macro_attribute]
277+
fn foo_oof(#[some_inert_attribute] arg: u8) {
274278
}
275279
```
276280

0 commit comments

Comments
 (0)