Skip to content

Commit 31e9f2f

Browse files
committed
Revise editorially
1 parent 1124ff3 commit 31e9f2f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/procedural-macros.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ r[macro.proc.derive]
134134
## The `proc_macro_derive` attribute
135135

136136
r[macro.proc.derive.intro]
137-
The *`proc_macro_derive` [attribute][attributes]* defines a *derive macro* which defines an input for the [`derive` attribute]. These macros can create new [items] given the token stream of a [struct], [enum], or [union]. They can also define [derive macro helper attributes].
137+
The *`proc_macro_derive` [attribute][attributes]* defines a *derive macro* that can be be invoked by the [`derive` attribute]. These macros are given the token stream of a [struct], [enum], or [union] definition and can emit new [items] after it. They can also define [derive macro helper attributes].
138138

139139
> [!EXAMPLE]
140-
> The following is an example of a derive macro. Instead of doing anything useful with its input, it just appends a function `answer`.
140+
> This derive macro ignores its input and appends tokens that define a function.
141141
>
142142
> <!-- ignore: test doesn't support proc-macro -->
143143
> ```rust,ignore
@@ -151,7 +151,7 @@ The *`proc_macro_derive` [attribute][attributes]* defines a *derive macro* which
151151
> }
152152
> ```
153153
>
154-
> And then using said derive macro:
154+
> To use it, we might write:
155155
>
156156
> <!-- ignore: requires external crates -->
157157
> ```rust,ignore
@@ -188,10 +188,10 @@ r[macro.proc.derive.duplicates]
188188
The `proc_macro_derive` attribute may only be specified once on a function.
189189

190190
r[macro.proc.derive.namespace]
191-
The `proc_macro_derive` attribute publicly defines the custom derive in the [macro namespace] in the root of the crate with the name given in the attribute.
191+
The `proc_macro_derive` attribute publicly defines the derive macro in the [macro namespace] in the root of the crate using the name given in the attribute.
192192

193193
r[macro.proc.derive.output]
194-
The input [`TokenStream`] is the token stream of the item that has the `derive` attribute on it. The output [`TokenStream`] must be a set of items that are then appended to the [module] or [block] that the item from the input [`TokenStream`] is in.
194+
The input [`TokenStream`] is the token stream of the item that has the `derive` attribute on it. The output [`TokenStream`] must be a set of items. These items are appended following the input item within the same [module] or [block].
195195

196196
r[macro.proc.derive.attributes]
197197
### Derive macro helper attributes

0 commit comments

Comments
 (0)