Skip to content

Commit bafd382

Browse files
authored
Fix more links (#1884)
1 parent 2ae8949 commit bafd382

10 files changed

+24
-25
lines changed

book.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ exclude = [
3838
"www\\.amazon\\.com",
3939
"www\\.rustaceans\\.org",
4040
"play\\.rust-lang\\.org",
41-
"tomlee\\.co"
41+
"tomlee\\.co",
42+
"marketplace\\.visualstudio\\.com",
43+
"objects\\.githubusercontent\\.com"
4244
]
4345
cache-timeout = 86400
4446
warning-policy = "error"

src/borrow_check/region_inference.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ common sorts of constraints are:
112112
(e.g. `'a: 'b`). Outlives constraints are generated by the [MIR type
113113
checker].
114114
2. Liveness constraints. Each region needs to be live at points where it can be
115-
used. These constraints are collected by [`generate_constraints`].
116-
117-
[`generate_constraints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/constraint_generation/fn.generate_constraints.html
115+
used.
118116

119117
## Inference Overview
120118

src/bound-vars-and-params.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Early-bound parameters
44

55
Early-bound parameters in rustc are identified by an index, stored in the
6-
[`ParamTy`] struct for types or the [`EarlyBoundRegion`] struct for lifetimes.
6+
[`ParamTy`] struct for types or the [`EarlyParamRegion`] struct for lifetimes.
77
The index counts from the outermost declaration in scope. This means that as you
88
add more binders inside, the index doesn't change.
99

@@ -24,7 +24,7 @@ In rustc, the [`Generics`] structure carries this information. So the
2424
in [this chapter](./generics.md).
2525

2626
[`ParamTy`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.ParamTy.html
27-
[`EarlyBoundRegion`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.EarlyBoundRegion.html
27+
[`EarlyParamRegion`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/region/struct.EarlyParamRegion.html
2828
[`Generics`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Generics.html
2929

3030
## Late-bound parameters

src/const-eval/interpret.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ further queries need to be executed in order to get at something as simple as a
9999
Future evaluations of the same constants will not actually invoke
100100
the interpreter, but just use the cached result.
101101

102-
[`Operand`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_const_eval/interpret/enum.Operand.html
102+
[`Operand`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_const_eval/interpret/operand/enum.Operand.html
103103
[`Immediate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_const_eval/interpret/enum.Immediate.html
104-
[`ConstValue`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/interpret/enum.ConstValue.html
104+
[`ConstValue`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/consts/enum.ConstValue.html
105105
[`Scalar`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/interpret/enum.Scalar.html
106106
[`op_to_const`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_const_eval/const_eval/eval_queries/fn.op_to_const.html
107107

src/diagnostics/diagnostic-structs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Diagnostic and subdiagnostic structs
22
rustc has three diagnostic derives that can be used to create simple diagnostics,
33
which are recommended to be used when they are applicable:
4-
`#[derive(Diagnostic)]`, #[derive(LintDiagnostic)], and `#[derive(Subdiagnostic)]`.
4+
`#[derive(Diagnostic)]`, `#[derive(LintDiagnostic)]`, and `#[derive(Subdiagnostic)]`.
55

66
Diagnostics created with the derive macros can be translated into different
77
languages and each has a slug that uniquely identifies the diagnostic.

src/diagnostics/error-codes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ written, as always: ask your reviewer or ask around on the Rust Discord or Zulip
2424

2525
[^new-explanations]: See the draft RFC [here][new-explanations-rfc].
2626

27-
[`rustc_error_codes`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_error_codes/error_codes/index.html
27+
[`rustc_error_codes`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_error_codes/index.html
2828
[CommonMark Spec]: https://spec.commonmark.org/current/
2929
[RFC 1567]: https://github.com/rust-lang/rfcs/blob/master/text/1567-long-error-codes-explanation-normalization.md
3030
[new-explanations-rfc]: https://github.com/rust-lang/rfcs/pull/3370

src/generics.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ inference, type checking, and trait solving. Conceptually, during these routines
66
that one type is equal to another type and want to swap one out for the other and then swap that out
77
for another type and so on until we eventually get some concrete types (or an error).
88

9-
In rustc this is done using [GenericArgsRef].
10-
Conceptually, you can think of `GenericArgsRef` as a list of types that are to be substituted for
9+
In rustc this is done using [GenericArgs].
10+
Conceptually, you can think of `GenericArgs` as a list of types that are to be substituted for
1111
the generic type parameters of the ADT.
1212

13-
`GenericArgsRef` is a type alias of `&'tcx List<GenericArg<'tcx>>` (see [`List` rustdocs][list]).
13+
`GenericArgs` is a type alias of `&'tcx List<GenericArg<'tcx>>` (see [`List` rustdocs][list]).
1414
[`GenericArg`] is essentially a space-efficient wrapper around [`GenericArgKind`], which is an enum
1515
indicating what kind of generic the type parameter is (type, lifetime, or const).
16-
Thus, `GenericArgsRef` is conceptually like a `&'tcx [GenericArgKind<'tcx>]` slice (but it is
16+
Thus, `GenericArgs` is conceptually like a `&'tcx [GenericArgKind<'tcx>]` slice (but it is
1717
actually a `List`).
1818

1919
[list]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.List.html
2020
[`GenericArg`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.GenericArg.html
2121
[`GenericArgKind`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/enum.GenericArgKind.html
22-
[GenericArgsRef]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.GenericArgsRef.html
22+
[GenericArgs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.GenericArgs.html
2323

2424
So why do we use this `List` type instead of making it really a slice? It has the length "inline",
2525
so `&List` is only 32 bits. As a consequence, it cannot be "subsliced" (that only works if the
@@ -37,10 +37,10 @@ struct MyStruct<T>
3737

3838
- There would be an `AdtDef` (and corresponding `DefId`) for `MyStruct`.
3939
- There would be a `TyKind::Param` (and corresponding `DefId`) for `T` (more later).
40-
- There would be a `GenericArgsRef` containing the list `[GenericArgKind::Type(Ty(T))]`
40+
- There would be a `GenericArgs` containing the list `[GenericArgKind::Type(Ty(T))]`
4141
- The `Ty(T)` here is my shorthand for entire other `ty::Ty` that has `TyKind::Param`, which we
4242
mentioned in the previous point.
43-
- This is one `TyKind::Adt` containing the `AdtDef` of `MyStruct` with the `GenericArgsRef` above.
43+
- This is one `TyKind::Adt` containing the `AdtDef` of `MyStruct` with the `GenericArgs` above.
4444

4545
Finally, we will quickly mention the
4646
[`Generics`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Generics.html) type. It
@@ -114,7 +114,7 @@ This example has a few different substitutions:
114114

115115
Let’s look a bit more closely at that last substitution to see why we use indexes. If we want to
116116
find the type of `foo.x`, we can get generic type of `x`, which is `Vec<Param(0)>`. Now we can take
117-
the index `0` and use it to find the right type substitution: looking at `Foo`'s `GenericArgsRef`,
117+
the index `0` and use it to find the right type substitution: looking at `Foo`'s `GenericArgs`,
118118
we have the list `[u32, f32]` , since we want to replace index `0`, we take the 0-th index of this
119119
list, which is `u32`. Voila!
120120

@@ -127,7 +127,7 @@ You may have a couple of followup questions…
127127
`MyStruct`: `Adt(Foo, &[Param(0), Param(1)])`.
128128

129129
How do we actually do the substitutions? There is a function for that too! You
130-
use [`instantiate`] to replace a `GenericArgsRef` with another list of types.
130+
use [`instantiate`] to replace a `GenericArgs` with another list of types.
131131

132132
[Here is an example of actually using `instantiate` in the compiler][instantiatex].
133133
The exact details are not too important, but in this piece of code, we happen to be

src/ty-fold.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ So to reiterate:
3535
- `TypeFoldable` is a trait that is implemented by things that embed types.
3636

3737
In the case of `subst`, we can see that it is implemented as a `TypeFolder`:
38-
[`SubstFolder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.SubstFolder.html).
38+
[`ArgFolder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/generic_args/struct.ArgFolder.html).
3939
Looking at its implementation, we see where the actual substitutions are happening.
4040

4141
However, you might also notice that the implementation calls this `super_fold_with` method. What is

src/ty.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ struct MyStruct<T> { x: u32, y: T }
287287
The type `MyStruct<u32>` would be an instance of `TyKind::Adt`:
288288

289289
```rust,ignore
290-
Adt(&'tcx AdtDef, GenericArgsRef<'tcx>)
290+
Adt(&'tcx AdtDef, GenericArgs<'tcx>)
291291
// ------------ ---------------
292292
// (1) (2)
293293
//
@@ -301,12 +301,12 @@ There are two parts:
301301
parameters. In our example, this is the `MyStruct` part *without* the argument `u32`.
302302
(Note that in the HIR, structs, enums and unions are represented differently, but in `ty::Ty`,
303303
they are all represented using `TyKind::Adt`.)
304-
- The [`GenericArgsRef`][GenericArgsRef] is an interned list of values that are to be substituted
304+
- The [`GenericArgs`][GenericArgs] is an interned list of values that are to be substituted
305305
for the generic parameters. In our example of `MyStruct<u32>`, we would end up with a list like
306306
`[u32]`. We’ll dig more into generics and substitutions in a little bit.
307307

308308
[adtdef]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.AdtDef.html
309-
[GenericArgsRef]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/type.GenericArgsRef.html
309+
[GenericArgs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.GenericArgs.html
310310

311311
**`AdtDef` and `DefId`**
312312

src/unsafety-checking.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,4 @@ the ast that searches for unsafe blocks, functions and implementations, as well
7575
as certain unsafe attributes.
7676

7777
[Unsafe traits]: https://doc.rust-lang.org/reference/items/traits.html#unsafe-traits
78-
[coherence]: /home/matthew/rust/compiler/rustc_hir_analysis/src/coherence/unsafety.rs
79-
78+
[coherence]: https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir_analysis/src/coherence/unsafety.rs

0 commit comments

Comments
 (0)