Skip to content

Commit 433e0f6

Browse files
authored
Fix rustc-related links that are 404 right now (#2112)
1 parent 7764847 commit 433e0f6

9 files changed

+18
-18
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ compiler.
66

77
Item | Kind | Short description | Chapter | Declaration
88
----------------|----------|-----------------------------|--------------------|-------------------
9-
`BodyId` | struct | One of four types of HIR node identifiers | [Identifiers in the HIR] | [compiler/rustc_hir/src/hir.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.BodyId.html)
9+
`BodyId` | struct | One of four types of HIR node identifiers | [Identifiers in the HIR] | [compiler/rustc_hir/src/hir.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.BodyId.html)
1010
`Compiler` | struct | Represents a compiler session and can be used to drive a compilation. | [The Rustc Driver and Interface] | [compiler/rustc_interface/src/interface.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/struct.Compiler.html)
1111
`ast::Crate` | struct | A syntax-level representation of a parsed crate | [The parser] | [compiler/rustc_ast/src/ast.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ast/struct.Crate.html)
12-
`rustc_hir::Crate` | struct | A more abstract, compiler-friendly form of a crate's AST | [The Hir] | [compiler/rustc_hir/src/hir.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Crate.html)
12+
`rustc_hir::Crate` | struct | A more abstract, compiler-friendly form of a crate's AST | [The Hir] | [compiler/rustc_hir/src/hir.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Crate.html)
1313
`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)
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)

Diff for: src/hir.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ data structure basically just contains the root module, the HIR
3737
`Crate` structure contains a number of maps and other things that
3838
serve to organize the content of the crate for easier access.
3939

40-
[`Crate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Crate.html
40+
[`Crate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Crate.html
4141

4242
For example, the contents of individual items (e.g. modules,
4343
functions, traits, impls, etc) in the HIR are not immediately
@@ -55,7 +55,7 @@ struct) would only have the **`ItemId`** `I` of `bar()`. To get the
5555
details of the function `bar()`, we would lookup `I` in the
5656
`items` map.
5757

58-
[`Mod`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Mod.html
58+
[`Mod`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Mod.html
5959

6060
One nice result from this representation is that one can iterate
6161
over all items in the crate by iterating over the key-value pairs
@@ -72,7 +72,7 @@ function to lookup the contents of `bar()` given its id; this gives
7272
the compiler a chance to observe that you accessed the data for
7373
`bar()`, and then record the dependency.
7474

75-
[`&rustc_hir::Item`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Item.html
75+
[`&rustc_hir::Item`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Item.html
7676

7777
<a name="hir-id"></a>
7878

@@ -120,9 +120,9 @@ that `n` must be some HIR expression, you can do
120120
[`&hir::Expr`][Expr], panicking if `n` is not in fact an expression.
121121

122122
[find]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.find
123-
[`Node`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/enum.Node.html
123+
[`Node`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/enum.Node.html
124124
[expect_expr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.expect_expr
125-
[Expr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Expr.html
125+
[Expr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Expr.html
126126

127127
Finally, you can use the HIR map to find the parents of nodes, via
128128
calls like [`tcx.hir().get_parent(n)`][get_parent].
@@ -139,6 +139,6 @@ associated with an **owner**, which is typically some kind of item
139139
associated with a given def-id ([`maybe_body_owned_by`]) or to find
140140
the owner of a body ([`body_owner_def_id`]).
141141

142-
[`rustc_hir::Body`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Body.html
142+
[`rustc_hir::Body`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Body.html
143143
[`maybe_body_owned_by`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.maybe_body_owned_by
144144
[`body_owner_def_id`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.body_owner_def_id

Diff for: src/identifiers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ See the [HIR chapter][hir-map] for more detailed information.
5252
[`DefId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def_id/struct.DefId.html
5353
[`LocalDefId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def_id/struct.LocalDefId.html
5454
[`HirId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir_id/struct.HirId.html
55-
[`BodyId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.BodyId.html
55+
[`BodyId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.BodyId.html
5656
[`CrateNum`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def_id/struct.CrateNum.html
5757
[`DefIndex`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def_id/struct.DefIndex.html
58-
[`Body`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Body.html
58+
[`Body`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Body.html
5959
[Node]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/enum.Node.html
6060
[hir-map]: ./hir.md#the-hir-map
6161
[hir-bodies]: ./hir.md#hir-bodies

Diff for: src/mir/optimizations.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ The array is an array of `&dyn MirPass` trait objects. Typically, a pass is
8484
implemented in its own module of the [`rustc_mir_transform`][trans] crate.
8585

8686
[rop]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/fn.run_optimization_passes.html
87-
[`MirPass`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/trait.MirPass.html
87+
[`MirPass`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/pass_manager/trait.MirPass.html
8888
[trans]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/index.html
8989

9090
Some examples of passes are:
@@ -94,7 +94,7 @@ Some examples of passes are:
9494

9595
You can see the ["Implementors" section of the `MirPass` rustdocs][impl] for more examples.
9696

97-
[impl]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/trait.MirPass.html#implementors
97+
[impl]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/pass_manager/trait.MirPass.html#implementors
9898
[constprop]: https://en.wikipedia.org/wiki/Constant_folding#Constant_propagation
9999

100100
## MIR optimization levels

Diff for: src/mir/passes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ queries are called before it actually steals, thus ensuring that the reads have
168168
simply loads from a cache the second time).
169169

170170
[rust-lang/rust#41710]: https://github.com/rust-lang/rust/issues/41710
171-
[mirpass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/trait.MirPass.html
171+
[mirpass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/pass_manager/trait.MirPass.html
172172
[lint1]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/check_packed_ref/struct.CheckPackedRef.html
173173
[lint2]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/check_const_item_mutation/struct.CheckConstItemMutation.html
174174
[lint3]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/function_item_references/struct.FunctionItemReferences.html

Diff for: src/opaque-types-impl-trait-inference.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ which is provable from the bounds declared on `Seq<T>`.
5555

5656
Let's start by looking what happens when we type-check `main`.
5757
Initially we invoke `produce_singleton` and the return type is an opaque type
58-
[`OpaqueTy`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/enum.ItemKind.html#variant.OpaqueTy).
58+
[`OpaqueTy`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/enum.ItemKind.html#variant.OpaqueTy).
5959

6060
#### Type-checking the for loop
6161

Diff for: src/rustdoc-internals.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ which describe the publicly-documentable items in the target crate.
7878
[`core.rs`]: https://github.com/rust-lang/rust/blob/master/src/librustdoc/core.rs
7979
[`Item`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/struct.Item.html
8080
[`run_global_ctxt`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/core/fn.run_global_ctxt.html
81-
[`rustc_hir::Crate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Crate.html
81+
[`rustc_hir::Crate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Crate.html
8282
[`rustdoc::core::DocContext`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/core/struct.DocContext.html
8383
[`rustdoc::core::run_global_ctxt`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/core/fn.run_global_ctxt.html
8484
[`visit_ast::Module`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/visit_ast/struct.Module.html

Diff for: src/thir.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ But it has some other interesting features that distinguish it from the HIR:
3535

3636
[HIR]: ./hir.md
3737
[`ExprId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/thir/struct.ExprId.html
38-
[body owners]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/enum.BodyOwnerKind.html
38+
[body owners]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/enum.BodyOwnerKind.html
3939

4040
The THIR lives in [`rustc_mir_build::thir`][thir-docs]. To construct a [`thir::Expr`],
4141
you can use the [`thir_body`] function, passing in the memory arena where the THIR

Diff for: src/ty.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The specific `Ty` we are referring to is [`rustc_middle::ty::Ty`][ty_ty] (and no
1717
into the details of `ty::Ty`.
1818

1919
[ty_ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Ty.html
20-
[hir_ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Ty.html
20+
[hir_ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Ty.html
2121

2222
## `rustc_hir::Ty` vs `ty::Ty`
2323

@@ -65,7 +65,7 @@ Here is a summary:
6565
| `fn foo(x: u32) → u32 { }` - Two `rustc_hir::Ty` representing each usage of `u32`, each has its own `Span`s, and `rustc_hir::Ty` doesn’t tell us that both are the same type | `fn foo(x: u32) → u32 { }` - One `ty::Ty` for all instances of `u32` throughout the program, and `ty::Ty` tells us that both usages of `u32` mean the same type. |
6666
| `fn foo(x: &u32) -> &u32)` - Two `rustc_hir::Ty` again. Lifetimes for the references show up in the `rustc_hir::Ty`s using a special marker, [`LifetimeName::Implicit`][implicit]. | `fn foo(x: &u32) -> &u32)`- A single `ty::Ty`. The `ty::Ty` has the hidden lifetime param. |
6767

68-
[implicit]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/enum.LifetimeName.html#variant.Implicit
68+
[implicit]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/enum.LifetimeName.html#variant.Implicit
6969

7070
**Order**
7171

0 commit comments

Comments
 (0)