]> git.proxmox.com Git - rustc.git/blob - src/doc/reference/src/macros.md
New upstream version 1.17.0+dfsg1
[rustc.git] / src / doc / reference / src / macros.md
1 # Macros
2
3 A number of minor features of Rust are not central enough to have their own
4 syntax, and yet are not implementable as functions. Instead, they are given
5 names, and invoked through a consistent syntax: `some_extension!(...)`.
6
7 Users of `rustc` can define new macros in two ways:
8
9 * [Macros] define new syntax in a higher-level,
10 declarative way.
11 * [Procedural Macros] can be used to implement custom derive.
12
13 And one unstable way: [compiler plugins].
14
15 [Macros]: ../book/macros.html
16 [Procedural Macros]: ../book/procedural-macros.html
17 [compiler plugins]: ../unstable-book/plugin.html