File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11# Derive
22
3+ r[ attributes.derive]
4+
5+
6+ r[ attributes.derived.general]
37The * ` 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
512traits to implement or paths to [ derive macros] to process.
613
714For 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]
3038You can implement ` derive ` for your own traits through [ procedural macros] .
3139
3240## The ` automatically_derived ` attribute
3341
42+ r[ attributes.derive.automatically_derived]
3443The * ` automatically_derived ` attribute* is automatically added to
3544[ implementations] created by the ` derive ` attribute for built-in traits. It
3645has no direct effect, but it may be used by tools and diagnostic lints to
You can’t perform that action at this time.
0 commit comments