Skip to content

Commit b5c6bab

Browse files
JohnTitorCentril
authored andcommitted
Fix links (#549)
1 parent a59a612 commit b5c6bab

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/appendix/code-index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Item | Kind | Short description | Chapter |
2121
`Query` | struct | Represents the result of query to the `Compiler` interface and allows stealing, borrowing, and returning the results of compiler passes. | [The Rustc Driver and Interface] | [src/librustc_interface/queries.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/queries/struct.Query.html)
2222
`Rib` | struct | Represents a single scope of names | [Name resolution] | [src/librustc_resolve/lib.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_resolve/late/struct.Rib.html)
2323
`Session` | struct | The data associated with a compilation session | [The parser], [The Rustc Driver and Interface] | [src/librustc/session/mod.html](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/struct.Session.html)
24-
`SourceFile` | struct | Part of the `SourceMap`. Maps AST nodes to their source code for a single source file. Was previously called FileMap | [The parser] | [src/libsyntax_pos/lib.rs](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/source_map/struct.SourceFile.html)
24+
`SourceFile` | struct | Part of the `SourceMap`. Maps AST nodes to their source code for a single source file. Was previously called FileMap | [The parser] | [src/librustc_span/lib.rs](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/source_map/struct.SourceFile.html)
2525
`SourceMap` | struct | Maps AST nodes to their source code. It is composed of `SourceFile`s. Was previously called CodeMap | [The parser] | [src/libsyntax/source_map.rs](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/source_map/struct.SourceMap.html)
26-
`Span` | struct | A location in the user's source code, used for error reporting primarily | [Emitting Diagnostics] | [src/libsyntax_pos/span_encoding.rs](https://doc.rust-lang.org/nightly/nightly-rustc/syntax_pos/struct.Span.html)
26+
`Span` | struct | A location in the user's source code, used for error reporting primarily | [Emitting Diagnostics] | [src/librustc_span/span_encoding.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/struct.Span.html)
2727
`StringReader` | struct | This is the lexer used during parsing. It consumes characters from the raw source code being compiled and produces a series of tokens for use by the rest of the parser | [The parser] | [src/librustc_parse/lexer/mod.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/lexer/struct.StringReader.html)
2828
`syntax::token_stream::TokenStream` | struct | An abstract sequence of tokens, organized into `TokenTree`s | [The parser], [Macro expansion] | [src/libsyntax/tokenstream.rs](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/tokenstream/struct.TokenStream.html)
2929
`TraitDef` | struct | This struct contains a trait's definition with type information | [The `ty` modules] | [src/librustc/ty/trait_def.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/trait_def/struct.TraitDef.html)

src/high-level-overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ rustc_codegen rustc_borrowck ... rustc_metadata
3636
syntax
3737
/ \
3838
/ \
39-
syntax_pos syntax_ext
39+
rustc_span rustc_builtin_macros
4040
```
4141

4242
The `rustc_driver` crate, at the top of this lattice, is effectively

src/macro-expansion.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Macro expansion
22

3-
> `libsyntax`, `librustc_expand`, and `libsyntax_ext` are all undergoing
3+
> `libsyntax`, `librustc_expand`, and `librustc_builtin_macros` are all undergoing
44
> refactoring, so some of the links in this chapter may be broken.
55
66
Macro expansion happens during parsing. `rustc` has two parsers, in fact: the
@@ -10,7 +10,7 @@ before name resolution, macros are expanded using these portions of the code.
1010
The macro parser, in turn, may call the normal Rust parser when it needs to
1111
bind a metavariable (e.g. `$my_expr`) while parsing the contents of a macro
1212
invocation. The code for macro expansion is in
13-
[`src/libsyntax_expand/mbe/`][code_dir]. This chapter aims to explain how macro
13+
[`src/librustc_expand/mbe/`][code_dir]. This chapter aims to explain how macro
1414
expansion works.
1515

1616
### Example
@@ -64,7 +64,7 @@ invocations. Interestingly, both are done by the macro parser.
6464
Basically, the macro parser is like an NFA-based regex parser. It uses an
6565
algorithm similar in spirit to the [Earley parsing
6666
algorithm](https://en.wikipedia.org/wiki/Earley_parser). The macro parser is
67-
defined in [`src/libsyntax_expand/mbe/macro_parser.rs`][code_mp].
67+
defined in [`src/librustc_expand/mbe/macro_parser.rs`][code_mp].
6868

6969
The interface of the macro parser is as follows (this is slightly simplified):
7070

@@ -113,7 +113,7 @@ normal Rust parser.
113113
As mentioned above, both definitions and invocations of macros are parsed using
114114
the macro parser. This is extremely non-intuitive and self-referential. The code
115115
to parse macro _definitions_ is in
116-
[`src/libsyntax_expand/mbe/macro_rules.rs`][code_mr]. It defines the pattern for
116+
[`src/librustc_expand/mbe/macro_rules.rs`][code_mr]. It defines the pattern for
117117
matching for a macro definition as `$( $lhs:tt => $rhs:tt );+`. In other words,
118118
a `macro_rules` definition should have in its body at least one occurrence of a
119119
token tree followed by `=>` followed by another token tree. When the compiler
@@ -142,7 +142,7 @@ the parse is ambiguous, while if there are no matches at all, there is a syntax
142142
error.
143143

144144
For more information about the macro parser's implementation, see the comments
145-
in [`src/libsyntax_expand/mbe/macro_parser.rs`][code_mp].
145+
in [`src/librustc_expand/mbe/macro_parser.rs`][code_mp].
146146

147147
### Hygiene
148148

@@ -208,10 +208,10 @@ TODO
208208
TODO: maybe something about macros 2.0?
209209
210210
211-
[code_dir]: https://github.com./rust-lang/rust/tree/master/src/libsyntax_expand/mbe
212-
[code_mp]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax_expand/mbe/macro_parser
213-
[code_mr]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax_expand/mbe/macro_rules
214-
[code_parse_int]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax_expand/mbe/macro_parser/fn.parse.html
211+
[code_dir]: https://github.com./rust-lang/rust/tree/master/src/librustc_expand/mbe
212+
[code_mp]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/mbe/macro_parser
213+
[code_mr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/mbe/macro_rules
214+
[code_parse_int]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/mbe/macro_parser/fn.parse.html
215215
[parsing]: ./the-parser.html
216216
217217
@@ -356,11 +356,11 @@ Vadim Petrochenkov: Here's some preliminary data I prepared.
356356
357357
Vadim Petrochenkov: Below I'll assume #62771 and #62086 has landed.
358358
359-
Vadim Petrochenkov: Where to find the code: libsyntax_pos/hygiene.rs -
359+
Vadim Petrochenkov: Where to find the code: librustc_span/hygiene.rs -
360360
structures related to hygiene and expansion that are kept in global data (can
361-
be accessed from any Ident without any context) libsyntax_pos/lib.rs - some
361+
be accessed from any Ident without any context) librustc_span/lib.rs - some
362362
secondary methods like macro backtrace using primary methods from hygiene.rs
363-
libsyntax_ext - implementations of built-in macros (including macro attributes
363+
librustc_builtin_macros - implementations of built-in macros (including macro attributes
364364
and derives) and some other early code generation facilities like injection of
365365
standard library imports or generation of test harness. libsyntax/config.rs -
366366
implementation of cfg/cfg_attr (they treated specially from other macros),
@@ -375,8 +375,8 @@ AST libsyntax/ext/placeholder.rs - the part of expand.rs responsible for
375375
"integrating the results back into AST" basicallly, "placeholder" is a
376376
temporary AST node replaced with macro expansion result nodes
377377
libsyntax/ext/builer.rs - helper functions for building AST for built-in macros
378-
in libsyntax_ext (and user-defined syntactic plugins previously), can probably
379-
be moved into libsyntax_ext these days libsyntax/ext/proc_macro.rs +
378+
in librustc_builtin_macros (and user-defined syntactic plugins previously), can probably
379+
be moved into librustc_builtin_macros these days libsyntax/ext/proc_macro.rs +
380380
libsyntax/ext/proc_macro_server.rs - interfaces between the compiler and the
381381
stable proc_macro library, converting tokens and token streams between the two
382382
representations and sending them through C ABI libsyntax/ext/tt -

0 commit comments

Comments
 (0)