Skip to content

Commit 5a07a85

Browse files
TbkhiNoratrieb
authored andcommitted
Update macro-expansion.md
removing parens
1 parent 2edd9e0 commit 5a07a85

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/macro-expansion.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ handled in [`rustc_expand::config`][cfg].
3636
Firstly, expansion happens at the crate level. Given a raw source code for
3737
a crate, the compiler will produce a massive `AST` with all `macro`s expanded, all
3838
modules inlined, etc. The primary entry point for this process is the
39-
[`MacroExpander::fully_expand_fragment()`][fef] method. With few exceptions, we
39+
[`MacroExpander::fully_expand_fragment`][fef] method. With few exceptions, we
4040
use this method on the whole crate (see ["Eager Expansion"](#eager-expansion)
4141
below for more detailed discussion of edge case expansion issues).
4242

4343
[`rustc_builtin_macros`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_builtin_macros/index.html
4444
[reb]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/build/index.html
4545

46-
At a high level, [`fully_expand_fragment()`][fef] works in iterations. We keep a
46+
At a high level, [`fully_expand_fragment`][fef] works in iterations. We keep a
4747
queue of unresolved `macro` invocations (i.e. `macro`s we haven't found the
4848
definition of yet). We repeatedly try to pick a `macro` from the queue, resolve
4949
it, expand it, and integrate it back. If we can't make progress in an
@@ -67,7 +67,7 @@ iteration, this represents a compile error. Here is the [algorithm][original]:
6767
each of which are a token (punctuation, identifier, or literal) or a
6868
delimited group (anything inside `()`/`[]`/`{}`)).
6969
- At this point, we know everything about the `macro` itself and can
70-
call [`set_expn_data()`] to fill in its properties in the global
70+
call [`set_expn_data`] to fill in its properties in the global
7171
data; that is the [hygiene] data associated with [`ExpnId`] (see
7272
[Hygiene][hybelow] below).
7373
2. Integrate that piece of `AST` into the currently-existing though
@@ -88,7 +88,7 @@ iteration, this represents a compile error. Here is the [algorithm][original]:
8888
- Names are put into modules (from the resolver's point of
8989
view) by [`BuildReducedGraphVisitor`].
9090
3. After expanding a single `macro` and integrating its output, continue
91-
to the next iteration of [`fully_expand_fragment()`][fef].
91+
to the next iteration of [`fully_expand_fragment`][fef].
9292
5. If it's not resolved:
9393
1. Put the `macro` back in the queue.
9494
2. Continue to next iteration...
@@ -100,7 +100,7 @@ iteration, this represents a compile error. Here is the [algorithm][original]:
100100
[`ExpnId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/hygiene/struct.ExpnId.html
101101
[`InvocationCollector`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/expand/struct.InvocationCollector.html
102102
[`NodeId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/node_id/struct.NodeId.html
103-
[`set_expn_data()`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/hygiene/struct.LocalExpnId.html#method.set_expn_data
103+
[`set_expn_data`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/hygiene/struct.LocalExpnId.html#method.set_expn_data
104104
[`SyntaxContext`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/hygiene/struct.SyntaxContext.html
105105
[`TokenStream`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/tokenstream/struct.TokenStream.html
106106
[defpath]: hir.md#identifiers-in-the-hir
@@ -262,7 +262,7 @@ crate.
262262
All of these hierarchies need some sort of "`macro` ID" to identify individual
263263
elements in the chain of expansions. This ID is [`ExpnId`]. All `macro`s receive
264264
an integer ID, assigned continuously starting from 0 as we discover new `macro`
265-
calls. All hierarchies start at [`ExpnId::root()`][rootid], which is its own
265+
calls. All hierarchies start at [`ExpnId::root`][rootid], which is its own
266266
parent.
267267
268268
The [`rustc_span::hygiene`][hy] library contains all of the hygiene-related algorithms
@@ -346,7 +346,7 @@ macro m() { ident }
346346
m!();
347347
```
348348

349-
Here `ident` originally has context [`SyntaxContext::root()`][scr]. `ident` has
349+
Here `ident` originally has context [`SyntaxContext::root`][scr]. `ident` has
350350
context `ROOT -> id(m)` after it's produced by `m`.
351351

352352
[scr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/hygiene/struct.SyntaxContext.html#method.root

0 commit comments

Comments
 (0)