From 1f720c0a76da44aefb5001e83bc9e0518ce02fca Mon Sep 17 00:00:00 2001 From: Emmet Horgan Date: Wed, 3 Sep 2025 23:29:54 +0100 Subject: [PATCH 1/4] Fix some broken links Signed-off-by: Emmet Horgan --- src/appendix/code-index.md | 2 +- src/compiler-debugging.md | 2 +- src/hir.md | 2 +- src/serialization.md | 2 +- src/tests/directives.md | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/appendix/code-index.md b/src/appendix/code-index.md index 65fbf752d..0ad724439 100644 --- a/src/appendix/code-index.md +++ b/src/appendix/code-index.md @@ -13,7 +13,7 @@ Item | Kind | Short description | Chapter | `DefId` | struct | One of four types of HIR node identifiers | [Identifiers in the HIR] | [compiler/rustc_hir/src/def_id.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def_id/struct.DefId.html) `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) `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) -`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) +`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/struct.HirId.html) `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) `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) `P` | struct | An owned immutable smart pointer. By contrast, `&T` is not owned, and `Box` is not immutable. | None | [compiler/rustc_ast/src/ptr.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ptr/struct.P.html) diff --git a/src/compiler-debugging.md b/src/compiler-debugging.md index edd2aa6c5..5ceb5dfe8 100644 --- a/src/compiler-debugging.md +++ b/src/compiler-debugging.md @@ -367,7 +367,7 @@ error: layout_of(&'a u32) = Layout { error: aborting due to previous error ``` -[`Layout`]: https://doc.rust-lang.org/nightly/nightly-rustc/stable_mir/abi/struct.Layout.html +[`Layout`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/struct.Layout.html ## Configuring CodeLLDB for debugging `rustc` diff --git a/src/hir.md b/src/hir.md index 38ba33112..0b341a40f 100644 --- a/src/hir.md +++ b/src/hir.md @@ -102,7 +102,7 @@ These identifiers can be converted into one another through the `TyCtxt`. [`DefId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def_id/struct.DefId.html [`LocalDefId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def_id/struct.LocalDefId.html -[`HirId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir_id/struct.HirId.html +[`HirId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.HirId.html [`BodyId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.BodyId.html [Node]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/enum.Node.html [`CrateNum`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def_id/struct.CrateNum.html diff --git a/src/serialization.md b/src/serialization.md index 8eb37bbe2..702d3cfa6 100644 --- a/src/serialization.md +++ b/src/serialization.md @@ -106,7 +106,7 @@ type wrapper, like [`ty::Predicate`] and manually implementing `Encodable` and [`Encodable`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_serialize/trait.Encodable.html [`Encoder`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_serialize/trait.Encoder.html [`RefDecodable`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/codec/trait.RefDecodable.html -[`rustc_middle`]: https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_type_ir/codec.rs.html#21 +[`rustc_middle`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/index.html [`ty::Predicate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/predicate/struct.Predicate.html [`TyCtxt`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html [`TyDecodable`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_macros/derive.TyDecodable.html diff --git a/src/tests/directives.md b/src/tests/directives.md index fbbeb7e97..c6d83e82a 100644 --- a/src/tests/directives.md +++ b/src/tests/directives.md @@ -38,7 +38,7 @@ sections that describe the command in more detail if available. This list may not be exhaustive. Directives can generally be found by browsing the `TestProps` structure found in [`header.rs`] from the compiletest source. -[`header.rs`]: https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/header.rs +[`header.rs`]: https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/directives.rs ### Assembly @@ -374,7 +374,7 @@ the directive's backing store (holds the command's current value) at runtime. To add a new directive property: 1. Look for the `pub struct TestProps` declaration in - [`src/tools/compiletest/src/header.rs`] and add the new public property to + [`src/tools/compiletest/src/directives.rs`] and add the new public property to the end of the declaration. 2. Look for the `impl TestProps` implementation block immediately following the struct declaration and initialize the new property to its default value. @@ -383,7 +383,7 @@ To add a new directive property: When `compiletest` encounters a test file, it parses the file a line at a time by calling every parser defined in the `Config` struct's implementation block, -also in [`src/tools/compiletest/src/header.rs`] (note that the `Config` struct's +also in [`src/tools/compiletest/src/directives.rs`] (note that the `Config` struct's declaration block is found in [`src/tools/compiletest/src/common.rs`]). `TestProps`'s `load_from()` method will try passing the current line of text to each parser, which, in turn typically checks to see if the line begins with a @@ -406,7 +406,7 @@ and their associated parsers immediately above to see how they are used to avoid writing additional parsing code unnecessarily. As a concrete example, here is the implementation for the -`parse_failure_status()` parser, in [`src/tools/compiletest/src/header.rs`]: +`parse_failure_status()` parser, in [`src/tools/compiletest/src/directives.rs`]: ```diff @@ -232,6 +232,7 @@ pub struct TestProps { @@ -508,6 +508,6 @@ example, `//@ failure-status: 1`, `self.props.failure_status` will evaluate to 1, as `parse_failure_status()` will have overridden the `TestProps` default value, for that test specifically. -[`src/tools/compiletest/src/header.rs`]: https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/header.rs +[`src/tools/compiletest/src/directives.rs`]: https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/directives.rs [`src/tools/compiletest/src/common.rs`]: https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/common.rs [`src/tools/compiletest/src/runtest.rs`]: https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/runtest.rs From fa294e67efb2613299ba039a1716458d9e830f1c Mon Sep 17 00:00:00 2001 From: emmet-horgan <80120110+emmet-horgan@users.noreply.github.com> Date: Thu, 4 Sep 2025 10:56:58 +0100 Subject: [PATCH 2/4] Update src/appendix/code-index.md Fix display string Co-authored-by: Tshepang Mbambo --- src/appendix/code-index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appendix/code-index.md b/src/appendix/code-index.md index 0ad724439..4ddb58b0c 100644 --- a/src/appendix/code-index.md +++ b/src/appendix/code-index.md @@ -13,7 +13,7 @@ Item | Kind | Short description | Chapter | `DefId` | struct | One of four types of HIR node identifiers | [Identifiers in the HIR] | [compiler/rustc_hir/src/def_id.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def_id/struct.DefId.html) `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) `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) -`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/struct.HirId.html) +`HirId` | struct | One of four types of HIR node identifiers | [Identifiers in the HIR] | [compiler/rustc_hir_id/src/lib.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.HirId.html) `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) `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) `P` | struct | An owned immutable smart pointer. By contrast, `&T` is not owned, and `Box` is not immutable. | None | [compiler/rustc_ast/src/ptr.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ptr/struct.P.html) From 44c40820d0d375e03d9389c14bcdb55b0eeab27e Mon Sep 17 00:00:00 2001 From: emmet-horgan <80120110+emmet-horgan@users.noreply.github.com> Date: Thu, 4 Sep 2025 11:00:25 +0100 Subject: [PATCH 3/4] Update src/compiler-debugging.md Change to public abi Co-authored-by: Tshepang Mbambo --- src/compiler-debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler-debugging.md b/src/compiler-debugging.md index 5ceb5dfe8..f45144704 100644 --- a/src/compiler-debugging.md +++ b/src/compiler-debugging.md @@ -367,7 +367,7 @@ error: layout_of(&'a u32) = Layout { error: aborting due to previous error ``` -[`Layout`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/struct.Layout.html +[`Layout`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_public/abi/struct.Layout.html ## Configuring CodeLLDB for debugging `rustc` From 7e4058ea5011a70b0c126c4d625c782aec13abf6 Mon Sep 17 00:00:00 2001 From: Emmet Horgan Date: Thu, 4 Sep 2025 12:46:12 +0100 Subject: [PATCH 4/4] Fix user facing string Signed-off-by: Emmet Horgan --- src/tests/directives.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/directives.md b/src/tests/directives.md index c6d83e82a..f58ee669a 100644 --- a/src/tests/directives.md +++ b/src/tests/directives.md @@ -36,9 +36,9 @@ directive. The following is a list of compiletest directives. Directives are linked to sections that describe the command in more detail if available. This list may not be exhaustive. Directives can generally be found by browsing the -`TestProps` structure found in [`header.rs`] from the compiletest source. +`TestProps` structure found in [`directives.rs`] from the compiletest source. -[`header.rs`]: https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/directives.rs +[`directives.rs`]: https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/directives.rs ### Assembly