Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b72fcb8

Browse files
committedJan 15, 2025·
Fix some broken links
* Rename `StringReader -> Lexer` * Remove deleted `Query` struct * Update some internal links
1 parent aca4d07 commit b72fcb8

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed
 

Diff for: ‎src/appendix/code-index.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ Item | Kind | Short description | Chapter |
1414
`Diag` | struct | A struct for a compiler diagnostic, such as an error or lint | [Emitting Diagnostics] | [compiler/rustc_errors/src/diagnostic.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.Diag.html)
1515
`DocContext` | struct | A state container used by rustdoc when crawling through a crate to gather its documentation | [Rustdoc] | [src/librustdoc/core.rs](https://github.com/rust-lang/rust/blob/master/src/librustdoc/core.rs)
1616
`HirId` | struct | One of four types of HIR node identifiers | [Identifiers in the HIR] | [compiler/rustc_hir/src/hir_id.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir_id/struct.HirId.html)
17+
`Lexer` | 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] | [compiler/rustc_parse/src/lexer/mod.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/lexer/struct.Lexer.html)
1718
`NodeId` | struct | One of four types of HIR node identifiers. Being phased out | [Identifiers in the HIR] | [compiler/rustc_ast/src/ast.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/node_id/struct.NodeId.html)
1819
`P` | struct | An owned immutable smart pointer. By contrast, `&T` is not owned, and `Box<T>` is not immutable. | None | [compiler/rustc_ast/src/ptr.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ptr/struct.P.html)
1920
`ParamEnv` | struct | Information about generic parameters or `Self`, useful for working with associated or generic items | [Parameter Environment] | [compiler/rustc_middle/src/ty/mod.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.ParamEnv.html)
2021
`ParseSess` | struct | This struct contains information about a parsing session | [The parser] | [compiler/rustc_session/src/parse/parse.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/parse/struct.ParseSess.html)
21-
`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] | [compiler/rustc_interface/src/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] | [compiler/rustc_resolve/src/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] | [compiler/rustc_session/src/session.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/struct.Session.html)
2424
`SourceFile` | struct | Part of the `SourceMap`. Maps AST nodes to their source code for a single source file. Was previously called FileMap | [The parser] | [compiler/rustc_span/src/lib.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/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] | [compiler/rustc_span/src/source_map.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/source_map/struct.SourceMap.html)
2626
`Span` | struct | A location in the user's source code, used for error reporting primarily | [Emitting Diagnostics] | [compiler/rustc_span/src/span_encoding.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/struct.Span.html)
27-
`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] | [compiler/rustc_parse/src/lexer/mod.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/lexer/struct.StringReader.html)
2827
`rustc_ast::token_stream::TokenStream` | struct | An abstract sequence of tokens, organized into `TokenTree`s | [The parser], [Macro expansion] | [compiler/rustc_ast/src/tokenstream.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/tokenstream/struct.TokenStream.html)
2928
`TraitDef` | struct | This struct contains a trait's definition with type information | [The `ty` modules] | [compiler/rustc_middle/src/ty/trait_def.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/trait_def/struct.TraitDef.html)
3029
`TraitRef` | struct | The combination of a trait and its input types (e.g. `P0: Trait<P1...Pn>`) | [Trait Solving: Goals and Clauses] | [compiler/rustc_middle/src/ty/sty.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.TraitRef.html)

Diff for: ‎src/guides/editions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ stability.
9191
## Edition parsing
9292

9393
For the most part, the lexer is edition-agnostic.
94-
Within [`StringReader`], tokens can be modified based on edition-specific behavior.
94+
Within [`Lexer`], tokens can be modified based on edition-specific behavior.
9595
For example, C-String literals like `c"foo"` are split into multiple tokens in editions before 2021.
9696
This is also where things like reserved prefixes are handled for the 2021 edition.
9797

@@ -114,7 +114,7 @@ For example, the deprecated `start...end` pattern syntax emits the
114114
[`ellipsis_inclusive_range_patterns`] lint on editions before 2021, and in 2021 is an hard error via
115115
the `emit_err` method.
116116

117-
[`StringReader`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/lexer/struct.StringReader.html
117+
[`Lexer`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/lexer/struct.Lexer.html
118118
[`ParseSess::edition`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/parse/struct.ParseSess.html#structfield.edition
119119
[`ellipsis_inclusive_range_patterns`]: https://doc.rust-lang.org/nightly/rustc/lints/listing/warn-by-default.html#ellipsis-inclusive-range-patterns
120120

Diff for: ‎src/overview.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Unicode character encoding.
3838

3939
The token stream passes through a higher-level lexer located in
4040
[`rustc_parse`] to prepare for the next stage of the compile process. The
41-
[`StringReader`] `struct` is used at this stage to perform a set of validations
41+
[`Lexer`] `struct` is used at this stage to perform a set of validations
4242
and turn strings into interned symbols (_interning_ is discussed later).
4343
[String interning] is a way of storing only one immutable
4444
copy of each distinct string value.
@@ -153,7 +153,7 @@ the final binary.
153153
[`rustc_parse::parser::Parser`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/parser/struct.Parser.html
154154
[`rustc_parse`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/index.html
155155
[`simplify_try`]: https://github.com/rust-lang/rust/pull/66282
156-
[`StringReader`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/lexer/struct.StringReader.html
156+
[`Lexer`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/lexer/struct.Lexer.html
157157
[`Ty<'tcx>`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Ty.html
158158
[borrow checking]: borrow_check.md
159159
[codegen]: backend/codegen.md

Diff for: ‎src/the-parser.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ the token stream, and then execute the parser to get a [`Crate`] (the root AST
5252
node).
5353

5454
To minimize the amount of copying that is done,
55-
both [`StringReader`] and [`Parser`] have lifetimes which bind them to the parent [`ParseSess`].
55+
both [`Lexer`] and [`Parser`] have lifetimes which bind them to the parent [`ParseSess`].
5656
This contains all the information needed while parsing, as well as the [`SourceMap`] itself.
5757

5858
Note that while parsing, we may encounter macro definitions or invocations.
@@ -67,7 +67,7 @@ Code for lexical analysis is split between two crates:
6767
constituting tokens. Although it is popular to implement lexers as generated
6868
finite state machines, the lexer in [`rustc_lexer`] is hand-written.
6969

70-
- [`StringReader`] integrates [`rustc_lexer`] with data structures specific to
70+
- [`Lexer`] integrates [`rustc_lexer`] with data structures specific to
7171
`rustc`. Specifically, it adds `Span` information to tokens returned by
7272
[`rustc_lexer`] and interns identifiers.
7373

@@ -76,7 +76,7 @@ Code for lexical analysis is split between two crates:
7676
[`ParseSess`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/parse/struct.ParseSess.html
7777
[`rustc_lexer`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lexer/index.html
7878
[`SourceMap`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/source_map/struct.SourceMap.html
79-
[`StringReader`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/lexer/struct.StringReader.html
79+
[`Lexer`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/lexer/struct.Lexer.html
8080
[ast module]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ast/index.html
8181
[ast]: ./ast-validation.md
8282
[parser]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/parser/index.html

Diff for: ‎src/ty_module/param_ty_const_regions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The rules against shadowing make this difficult but those language rules could c
6565

6666
### Lifetime parameters
6767

68-
In contrast to `Ty`/`Const`'s `Param` singular `Param` variant, lifetimes have two variants for representing region parameters: [`RegionKind::EarlyParam`] and [`RegionKind::LateParam`]. The reason for this is due to function's distinguishing between [early and late bound parameters](../early-late-bound-params/early-late-bound-summary.md) which is discussed in an earlier chapter (see link).
68+
In contrast to `Ty`/`Const`'s `Param` singular `Param` variant, lifetimes have two variants for representing region parameters: [`RegionKind::EarlyParam`] and [`RegionKind::LateParam`]. The reason for this is due to function's distinguishing between [early and late bound parameters][ch_early_late_bound] which is discussed in an earlier chapter (see link).
6969

7070
`RegionKind::EarlyParam` is structured identically to `Ty/Const`'s `Param` variant, it is simply a `u32` index and a `Symbol`. For lifetime parameters defined on non-function items we always use `ReEarlyParam`. For functions we use `ReEarlyParam` for any early bound parameters and `ReLateParam` for any late bound parameters. Note that just like `Ty` and `Const` params we often debug format them as `'SYMBOL/#INDEX`, see for example:
7171

@@ -85,7 +85,7 @@ fn foo<'a, 'b, T: 'a>(one: T, two: &'a &'b u32) -> &'b u32 {
8585

8686
`RegionKind::LateParam` will be discussed more in the chapter on [instantiating binders][ch_instantiating_binders].
8787

88-
[ch_early_late_bound]: ../early-late-bound-params/early-late-bound-summary.md
88+
[ch_early_late_bound]: ../generic_parameters_summary.md
8989
[ch_binders]: ./binders.md
9090
[ch_instantiating_binders]: ./instantiating_binders.md
9191
[`BoundRegionKind`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/enum.BoundRegionKind.html

0 commit comments

Comments
 (0)
Please sign in to comment.