@@ -598,6 +598,14 @@ names, and invoked through a consistent syntax: `name!(...)`. Examples include:
598598
599599All of the above extensions are expressions with values.
600600
601+ Users of ` rustc ` can define new syntax extensions in two ways:
602+
603+ * [ Compiler plugins] ( guide-plugin.html#syntax-extensions ) can include arbitrary
604+ Rust code that manipulates syntax trees at compile time.
605+
606+ * [ Macros] ( guide-macros.html ) define new syntax in a higher-level,
607+ declarative way.
608+
601609## Macros
602610
603611``` {.ebnf .gram}
@@ -615,7 +623,7 @@ transcriber : '(' transcriber * ')' | '[' transcriber * ']'
615623
616624User-defined syntax extensions are called "macros", and the ` macro_rules `
617625syntax extension defines them. Currently, user-defined macros can expand to
618- expressions, statements, or items .
626+ expressions, statements, items, or patterns .
619627
620628(A ` sep_token ` is any token other than ` * ` and ` + ` . A ` non_special_token ` is
621629any token other than a delimiter or ` $ ` .)
@@ -1912,7 +1920,7 @@ type int8_t = i8;
19121920- ` main ` - indicates that this function should be passed to the entry point,
19131921 rather than the function in the crate root named ` main ` .
19141922- ` plugin_registrar ` - mark this function as the registration point for
1915- compiler plugins, such as loadable syntax extensions.
1923+ [ compiler plugins] [ plugin ] , such as loadable syntax extensions.
19161924- ` start ` - indicates that this function should be used as the entry point,
19171925 overriding the "start" language item. See the "start" [ language
19181926 item] ( #language-items ) for more details.
@@ -1972,8 +1980,8 @@ On `struct`s:
19721980 align fields.
19731981- ` phase ` - on ` extern crate ` statements, allows specifying which "phase" of
19741982 compilation the crate should be loaded for. Currently, there are two
1975- choices: ` link ` and ` plugin ` . ` link ` is the default. ` plugin ` will load the
1976- crate at compile-time and use any syntax extensions or lints that the crate
1983+ choices: ` link ` and ` plugin ` . ` link ` is the default. ` plugin ` will [ load the
1984+ crate at compile-time] [ plugin ] and use any syntax extensions or lints that the crate
19771985 defines. They can both be specified, ` #[phase(link, plugin)] ` to use a crate
19781986 both at runtime and compiletime.
19791987- ` simd ` - on certain tuple structs, derive the arithmetic operators, which
@@ -2061,7 +2069,8 @@ For any lint check `C`:
20612069* ` warn(C) ` warns about violations of ` C ` but continues compilation.
20622070
20632071The lint checks supported by the compiler can be found via ` rustc -W help ` ,
2064- along with their default settings.
2072+ along with their default settings. [ Compiler
2073+ plugins] ( guide-plugin.html#lint-plugins ) can provide additional lint checks.
20652074
20662075``` {.ignore}
20672076mod m1 {
@@ -2490,7 +2499,7 @@ The currently implemented features of the reference compiler are:
24902499 considered unwholesome and in need of overhaul, and it is not clear
24912500 what they will look like moving forward.
24922501
2493- * ` plugin_registrar ` - Indicates that a crate has compiler plugins that it
2502+ * ` plugin_registrar ` - Indicates that a crate has [ compiler plugins] [ plugin ] that it
24942503 wants to load. As with ` phase ` , the implementation is
24952504 in need of a overhaul, and it is not clear that plugins
24962505 defined using this will continue to work.
@@ -4304,3 +4313,4 @@ Additional specific influences can be seen from the following languages:
43044313* The block syntax of Ruby.
43054314
43064315[ ffi ] : guide-ffi.html
4316+ [ plugin ] : guide-plugin.html
0 commit comments