Skip to content

Commit 3b6ebe1

Browse files
committed
Add identifier syntax to attributes.derive
1 parent 41fe211 commit 3b6ebe1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/attributes/derive.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# Derive
22

3+
r[attributes.derive]
4+
5+
6+
r[attributes.derived.general]
37
The *`derive` attribute* allows new [items] to be automatically generated for
4-
data structures. It uses the [_MetaListPaths_] syntax to specify a list of
8+
data structures.
9+
10+
r[attributes.derive.syntax]
11+
It uses the [_MetaListPaths_] syntax to specify a list of
512
traits to implement or paths to [derive macros] to process.
613

714
For example, the following will create an [`impl` item] for the
@@ -27,10 +34,12 @@ impl<T: PartialEq> PartialEq for Foo<T> {
2734
}
2835
```
2936

37+
r[attributes.derive.proc-macro]
3038
You can implement `derive` for your own traits through [procedural macros].
3139

3240
## The `automatically_derived` attribute
3341

42+
r[attributes.derive.automatically_derived]
3443
The *`automatically_derived` attribute* is automatically added to
3544
[implementations] created by the `derive` attribute for built-in traits. It
3645
has no direct effect, but it may be used by tools and diagnostic lints to

0 commit comments

Comments
 (0)