Skip to content

Commit 1dec176

Browse files
committed
Fix all the links to be relative for mdbook 2
1 parent a601a9f commit 1dec176

19 files changed

+108
-108
lines changed

src/appendix/background.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ and Michael I. Schwartzbach is an incredible resource!
9494
Check out the subtyping chapter from the
9595
[Rust Nomicon](https://doc.rust-lang.org/nomicon/subtyping.html).
9696

97-
See the [variance](./variance.html) chapter of this guide for more info on how
97+
See the [variance](../variance.html) chapter of this guide for more info on how
9898
the type checker handles variance.
9999

100100
<a name="free-vs-bound"></a>

src/appendix/code-index.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ Item | Kind | Short description | Chapter |
2929
`Ty<'tcx>` | struct | This is the internal representation of a type used for type checking | [Type checking] | [src/librustc/ty/mod.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/type.Ty.html)
3030
`TyCtxt<'cx, 'tcx, 'tcx>` | type | The "typing context". This is the central data structure in the compiler. It is the context that you use to perform all manner of queries | [The `ty` modules] | [src/librustc/ty/context.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.TyCtxt.html)
3131

32-
[The HIR]: hir.html
33-
[Identifiers in the HIR]: hir.html#hir-id
34-
[The parser]: the-parser.html
35-
[The Rustc Driver]: rustc-driver.html
36-
[Type checking]: type-checking.html
37-
[The `ty` modules]: ty.html
38-
[Rustdoc]: rustdoc.html
39-
[Emitting Diagnostics]: diag.html
40-
[Macro expansion]: macro-expansion.html
41-
[Name resolution]: name-resolution.html
42-
[Parameter Environment]: param_env.html
43-
[Trait Solving: Goals and Clauses]: traits/goals-and-clauses.html#domain-goals
44-
[Trait Solving: Lowering impls]: traits/lowering-rules.html#lowering-impls
32+
[The HIR]: ../hir.html
33+
[Identifiers in the HIR]: ../hir.html#hir-id
34+
[The parser]: ../the-parser.html
35+
[The Rustc Driver]: ../rustc-driver.html
36+
[Type checking]: ../type-checking.html
37+
[The `ty` modules]: ../ty.html
38+
[Rustdoc]: ../rustdoc.html
39+
[Emitting Diagnostics]: ../diag.html
40+
[Macro expansion]: ../macro-expansion.html
41+
[Name resolution]: ../name-resolution.html
42+
[Parameter Environment]: ../param_env.html
43+
[Trait Solving: Goals and Clauses]: ../traits/goals-and-clauses.html#domain-goals
44+
[Trait Solving: Lowering impls]: ../traits/lowering-rules.html#lowering-impls

src/appendix/glossary.md

+29-29
Large diffs are not rendered by default.

src/mir/borrowck.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ enforcing a number of properties:
1212
- etc
1313

1414
At the time of this writing, the code is in a state of transition. The
15-
"main" borrow checker still works by processing [the HIR](hir.html),
15+
"main" borrow checker still works by processing [the HIR](../hir.html),
1616
but that is being phased out in favor of the MIR-based borrow checker.
1717
Doing borrow checking on MIR has two key advantages:
1818

@@ -43,15 +43,15 @@ The overall flow of the borrow checker is as follows:
4343
include references to the new regions that we are computing.
4444
- We then invoke `nll::replace_regions_in_mir` to modify this copy C.
4545
Among other things, this function will replace all of the regions in
46-
the MIR with fresh [inference variables](./appendix/glossary.html).
47-
- (More details can be found in [the regionck section](./mir/regionck.html).)
46+
the MIR with fresh [inference variables](../appendix/glossary.html).
47+
- (More details can be found in [the regionck section](./regionck.html).)
4848
- Next, we perform a number of [dataflow
49-
analyses](./appendix/background.html#dataflow)
49+
analyses](../appendix/background.html#dataflow)
5050
that compute what data is moved and when. The results of these analyses
5151
are needed to do both borrow checking and region inference.
5252
- Using the move data, we can then compute the values of all the regions in the
5353
MIR.
54-
- (More details can be found in [the NLL section](./mir/regionck.html).)
54+
- (More details can be found in [the NLL section](./regionck.html).)
5555
- Finally, the borrow checker itself runs, taking as input (a) the
5656
results of move analysis and (b) the regions computed by the region
5757
checker. This allows us to figure out which loans are still in scope

src/mir/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The MIR (Mid-level IR)
22

33
MIR is Rust's _Mid-level Intermediate Representation_. It is
4-
constructed from [HIR](./hir.html). MIR was introduced in
4+
constructed from [HIR](../hir.html). MIR was introduced in
55
[RFC 1211]. It is a radically simplified form of Rust that is used for
66
certain flow-sensitive safety checks – notably the borrow checker! –
77
and also for optimization and code generation.
@@ -26,7 +26,7 @@ Some of the key characteristics of MIR are:
2626
- It does not have nested expressions.
2727
- All types in MIR are fully explicit.
2828

29-
[cfg]: ./appendix/background.html#cfg
29+
[cfg]: ../appendix/background.html#cfg
3030

3131
## Key MIR vocabulary
3232

@@ -244,4 +244,4 @@ but [you can read about those below](#promoted)).
244244
[mir]: https://github.com/rust-lang/rust/tree/master/src/librustc/mir
245245
[mirmanip]: https://github.com/rust-lang/rust/tree/master/src/librustc_mir
246246
[mir]: https://github.com/rust-lang/rust/tree/master/src/librustc/mir
247-
[newtype'd]: appendix/glossary.html
247+
[newtype'd]: ../appendix/glossary.html

src/mir/passes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ then `mir_const_qualif(D)` would succeed if it came before
156156
`mir_validated(D)`, but fail otherwise. Therefore, `mir_validated(D)`
157157
will **force** `mir_const_qualif` before it actually steals, thus
158158
ensuring that the reads have already happened (remember that
159-
[queries are memoized](./query.html), so executing a query twice
159+
[queries are memoized](../query.html), so executing a query twice
160160
simply loads from a cache the second time):
161161

162162
```text
@@ -174,4 +174,4 @@ alternatives in [rust-lang/rust#41710].
174174
[rust-lang/rust#41710]: https://github.com/rust-lang/rust/issues/41710
175175
[mirtransform]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/transform/
176176
[`NoLandingPads`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/transform/no_landing_pads/struct.NoLandingPads.html
177-
[MIR visitor]: mir/visitor.html
177+
[MIR visitor]: ./visitor.html

src/mir/regionck.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The MIR-based region analysis consists of two major functions:
3535
- More details to come, though the [NLL RFC] also includes fairly thorough
3636
(and hopefully readable) coverage.
3737

38-
[fvb]: appendix/background.html#free-vs-bound
38+
[fvb]: ../appendix/background.html#free-vs-bound
3939
[NLL RFC]: http://rust-lang.github.io/rfcs/2094-nll.html
4040

4141
## Universal regions
@@ -131,7 +131,7 @@ the type of `foo` the type `bar` expects
131131
We handle this sort of subtyping by taking the variables that are
132132
bound in the supertype and **skolemizing** them: this means that we
133133
replace them with
134-
[universally quantified](appendix/background.html#quantified)
134+
[universally quantified](../appendix/background.html#quantified)
135135
representatives, written like `!1`. We call these regions "skolemized
136136
regions" – they represent, basically, "some unknown region".
137137

@@ -148,7 +148,7 @@ what we wanted.
148148

149149
So let's work through what happens next. To check if two functions are
150150
subtypes, we check if their arguments have the desired relationship
151-
(fn arguments are [contravariant](./appendix/background.html#variance), so
151+
(fn arguments are [contravariant](../appendix/background.html#variance), so
152152
we swap the left and right here):
153153

154154
```text
@@ -187,7 +187,7 @@ Here, the root universe would consist of the lifetimes `'static` and
187187
the same concept to types, in which case the types `Foo` and `T` would
188188
be in the root universe (along with other global types, like `i32`).
189189
Basically, the root universe contains all the names that
190-
[appear free](./appendix/background.html#free-vs-bound) in the body of `bar`.
190+
[appear free](../appendix/background.html#free-vs-bound) in the body of `bar`.
191191

192192
Now let's extend `bar` a bit by adding a variable `x`:
193193

src/tests/intro.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ by the build system (`x.py test`). The main test harness for testing
55
the compiler itself is a tool called compiletest (sources in the
66
[`src/tools/compiletest`]). This section gives a brief overview of how
77
the testing framework is setup, and then gets into some of the details
8-
on [how to run tests](./tests/running.html#ui) as well as
9-
[how to add new tests](./tests/adding.html).
8+
on [how to run tests](./running.html#ui) as well as
9+
[how to add new tests](./adding.html).
1010

1111
[`src/tools/compiletest`]: https://github.com/rust-lang/rust/tree/master/src/tools/compiletest
1212

@@ -24,7 +24,7 @@ Here is a brief summary of the test suites as of this writing and what
2424
they mean. In some cases, the test suites are linked to parts of the manual
2525
that give more details.
2626

27-
- [`ui`](./tests/adding.html#ui) – tests that check the exact
27+
- [`ui`](./adding.html#ui) – tests that check the exact
2828
stdout/stderr from compilation and/or running the test
2929
- `run-pass` – tests that are expected to compile and execute
3030
successfully (no panics)
@@ -59,7 +59,7 @@ including:
5959
- **Tidy** – This is a custom tool used for validating source code
6060
style and formatting conventions, such as rejecting long lines.
6161
There is more information in the
62-
[section on coding conventions](./conventions.html#formatting).
62+
[section on coding conventions](../conventions.html#formatting).
6363

6464
Example: `./x.py test src/tools/tidy`
6565

src/traits/associated-types.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type can be referenced by the user using an **associated type
1717
projection** like `<Option<u32> as IntoIterator>::Item`. (Often,
1818
though, people will use the shorthand syntax `T::Item` – presently,
1919
that syntax is expanded during
20-
["type collection"](./type-checking.html) into the explicit form,
20+
["type collection"](../type-checking.html) into the explicit form,
2121
though that is something we may want to change in the future.)
2222

2323
[intoiter-item]: https://doc.rust-lang.org/nightly/core/iter/trait.IntoIterator.html#associatedtype.Item
@@ -130,7 +130,7 @@ any given associated item.
130130

131131
Now we are ready to discuss how associated type equality integrates
132132
with unification. As described in the
133-
[type inference](./type-inference.html) section, unification is
133+
[type inference](../type-inference.html) section, unification is
134134
basically a procedure with a signature like this:
135135

136136
```text

src/traits/caching.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ On the other hand, if there is no hit, we need to go through the [selection
2424
process] from scratch. Suppose, we come to the conclusion that the only
2525
possible impl is this one, with def-id 22:
2626

27-
[selection process]: ./traits/resolution.html#selection
27+
[selection process]: ./resolution.html#selection
2828

2929
```rust,ignore
3030
impl Foo<isize> for usize { ... } // Impl #22
@@ -34,7 +34,7 @@ We would then record in the cache `usize : Foo<$0> => ImplCandidate(22)`. Next
3434
we would [confirm] `ImplCandidate(22)`, which would (as a side-effect) unify
3535
`$t` with `isize`.
3636

37-
[confirm]: ./traits/resolution.html#confirmation
37+
[confirm]: ./resolution.html#confirmation
3838

3939
Now, at some later time, we might come along and see a `usize :
4040
Foo<$u>`. When skolemized, this would yield `usize : Foo<$0>`, just as
@@ -61,7 +61,7 @@ to be pretty clearly safe and also still retains a very high hit rate
6161
**TODO**: it looks like `pick_candidate_cache` no longer exists. In
6262
general, is this section still accurate at all?
6363

64-
[`ParamEnv`]: ./param_env.html
65-
[`tcx`]: ./ty.html
64+
[`ParamEnv`]: ../param_env.html
65+
[`tcx`]: ../ty.html
6666
[#18290]: https://github.com/rust-lang/rust/issues/18290
6767
[#22019]: https://github.com/rust-lang/rust/issues/22019

src/traits/canonical-queries.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
The "start" of the trait system is the **canonical query** (these are
44
both queries in the more general sense of the word – something you
55
would like to know the answer to – and in the
6-
[rustc-specific sense](./query.html)). The idea is that the type
6+
[rustc-specific sense](../query.html)). The idea is that the type
77
checker or other parts of the system, may in the course of doing their
88
thing want to know whether some trait is implemented for some type
99
(e.g., is `u32: Debug` true?). Or they may want to
10-
[normalize some associated type](./traits/associated-types.html).
10+
[normalize some associated type](./associated-types.html).
1111

1212
This section covers queries at a fairly high level of abstraction. The
1313
subsections look a bit more closely at how these ideas are implemented
@@ -106,7 +106,7 @@ value for a type variable, that means that this is the **only possible
106106
instantiation** that you could use, given the current set of impls and
107107
where-clauses, that would be provable. (Internally within the solver,
108108
though, they can potentially enumerate all possible answers. See
109-
[the description of the SLG solver](./traits/slg.html) for details.)
109+
[the description of the SLG solver](./slg.html) for details.)
110110

111111
The response to a trait query in rustc is typically a
112112
`Result<QueryResult<T>, NoSolution>` (where the `T` will vary a bit
@@ -132,7 +132,7 @@ we did find. It consists of four parts:
132132
- **Region constraints:** these are relations that must hold between
133133
the lifetimes that you supplied as inputs. We'll ignore these here,
134134
but see the
135-
[section on handling regions in traits](./traits/regions.html) for
135+
[section on handling regions in traits](./regions.html) for
136136
more details.
137137
- **Value:** The query result also comes with a value of type `T`. For
138138
some specialized queries – like normalizing associated types –
@@ -219,7 +219,7 @@ As a result of this assignment, the type of `u` is forced to be
219219
`Option<Vec<?V>>`, where `?V` represents the element type of the
220220
vector. This in turn implies that `?U` is [unified] to `Vec<?V>`.
221221

222-
[unified]: ./type-checking.html
222+
[unified]: ../type-checking.html
223223

224224
Let's suppose that the type checker decides to revisit the
225225
"as-yet-unproven" trait obligation we saw before, `Vec<?T>:

src/traits/canonicalization.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ from its context. It is a key part of implementing
66
to get more context.
77

88
Canonicalization is really based on a very simple concept: every
9-
[inference variable](./type-inference.html#vars) is always in one of
9+
[inference variable](../type-inference.html#vars) is always in one of
1010
two states: either it is **unbound**, in which case we don't know yet
1111
what type it is, or it is **bound**, in which case we do. So to
1212
isolate some data-structure T that contains types/regions from its
@@ -16,7 +16,7 @@ starting from zero and numbered in a fixed order (left to right, for
1616
the most part, but really it doesn't matter as long as it is
1717
consistent).
1818

19-
[cq]: ./traits/canonical-queries.html
19+
[cq]: ./canonical-queries.html
2020

2121
So, for example, if we have the type `X = (?T, ?U)`, where `?T` and
2222
`?U` are distinct, unbound inference variables, then the canonical
@@ -41,7 +41,7 @@ trait query: `?A: Foo<'static, ?B>`, where `?A` and `?B` are unbound.
4141
This query contains two unbound variables, but it also contains the
4242
lifetime `'static`. The trait system generally ignores all lifetimes
4343
and treats them equally, so when canonicalizing, we will *also*
44-
replace any [free lifetime](./appendix/background.html#free-vs-bound) with a
44+
replace any [free lifetime](../appendix/background.html#free-vs-bound) with a
4545
canonical variable. Therefore, we get the following result:
4646

4747
```text
@@ -98,12 +98,12 @@ Remember that substitution S though! We're going to need it later.
9898

9999
OK, now that we have a fresh inference context and an instantiated
100100
query, we can go ahead and try to solve it. The trait solver itself is
101-
explained in more detail in [another section](./traits/slg.html), but
101+
explained in more detail in [another section](./slg.html), but
102102
suffice to say that it will compute a [certainty value][cqqr] (`Proven` or
103103
`Ambiguous`) and have side-effects on the inference variables we've
104104
created. For example, if there were only one impl of `Foo`, like so:
105105

106-
[cqqr]: ./traits/canonical-queries.html#query-response
106+
[cqqr]: ./canonical-queries.html#query-response
107107

108108
```rust,ignore
109109
impl<'a, X> Foo<'a, X> for Vec<X>

src/traits/chalk-overview.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,18 @@ See [The SLG Solver][slg].
131131

132132
[rustc-issues]: https://github.com/rust-lang-nursery/rustc-guide/issues
133133
[chalk]: https://github.com/rust-lang-nursery/chalk
134-
[lowering-to-logic]: traits/lowering-to-logic.html
135-
[lowering-rules]: traits/lowering-rules.html
134+
[lowering-to-logic]: ./lowering-to-logic.html
135+
[lowering-rules]: ./lowering-rules.html
136136
[ast]: https://en.wikipedia.org/wiki/Abstract_syntax_tree
137137
[chalk-ast]: https://github.com/rust-lang-nursery/chalk/blob/master/chalk-parse/src/ast.rs
138138
[universal quantification]: https://en.wikipedia.org/wiki/Universal_quantification
139-
[lowering-forall]: ./traits/lowering-to-logic.html#type-checking-generic-functions-beyond-horn-clauses
139+
[lowering-forall]: ./lowering-to-logic.html#type-checking-generic-functions-beyond-horn-clauses
140140
[programclause]: https://github.com/rust-lang-nursery/chalk/blob/94a1941a021842a5fcb35cd043145c8faae59f08/src/ir.rs#L721
141141
[clause]: https://github.com/rust-lang-nursery/chalk/blob/master/GLOSSARY.md#clause
142-
[goals-and-clauses]: ./traits/goals-and-clauses.html
142+
[goals-and-clauses]: ./goals-and-clauses.html
143143
[well-formedness-checks]: https://github.com/rust-lang-nursery/chalk/blob/94a1941a021842a5fcb35cd043145c8faae59f08/src/ir/lowering.rs#L230-L232
144144
[ir-code]: https://github.com/rust-lang-nursery/chalk/blob/master/src/ir.rs
145-
[HIR]: hir.html
145+
[HIR]: ../hir.html
146146
[binders-struct]: https://github.com/rust-lang-nursery/chalk/blob/94a1941a021842a5fcb35cd043145c8faae59f08/src/ir.rs#L661
147147
[rules-environment]: https://github.com/rust-lang-nursery/chalk/blob/94a1941a021842a5fcb35cd043145c8faae59f08/src/rules.rs#L9
148-
[slg]: ./traits/slg.html
148+
[slg]: ./slg.html

src/traits/goals-and-clauses.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In logic programming terms, a **goal** is something that you must
44
prove and a **clause** is something that you know is true. As
5-
described in the [lowering to logic](./traits/lowering-to-logic.html)
5+
described in the [lowering to logic](./lowering-to-logic.html)
66
chapter, Rust's trait solver is based on an extension of hereditary
77
harrop (HH) clauses, which extend traditional Prolog Horn clauses with
88
a few new superpowers.
@@ -37,7 +37,7 @@ paper
3737
["A Proof Procedure for the Logic of Hereditary Harrop Formulas"][pphhf]
3838
gives the details.
3939

40-
[pphhf]: ./traits/bibliography.html#pphhf
40+
[pphhf]: ./bibliography.html#pphhf
4141

4242
<a name="domain-goals"></a>
4343

@@ -94,20 +94,20 @@ e.g. `ProjectionEq<T as Iterator>::Item = u8`
9494

9595
The given associated type `Projection` is equal to `Type`; this can be proved
9696
with either normalization or using skolemized types. See [the section
97-
on associated types](./traits/associated-types.html).
97+
on associated types](./associated-types.html).
9898

9999
#### Normalize(Projection -> Type)
100100
e.g. `ProjectionEq<T as Iterator>::Item -> u8`
101101

102102
The given associated type `Projection` can be [normalized][n] to `Type`.
103103

104104
As discussed in [the section on associated
105-
types](./traits/associated-types.html), `Normalize` implies `ProjectionEq`,
105+
types](./associated-types.html), `Normalize` implies `ProjectionEq`,
106106
but not vice versa. In general, proving `Normalize(<T as Trait>::Item -> U)`
107107
also requires proving `Implemented(T: Trait)`.
108108

109-
[n]: ./traits/associated-types.html#normalize
110-
[at]: ./traits/associated-types.html
109+
[n]: ./associated-types.html#normalize
110+
[at]: ./associated-types.html
111111

112112
#### FromEnv(TraitRef), FromEnv(Projection = Type)
113113
e.g. `FromEnv(Self: Add<i32>)`
@@ -212,7 +212,7 @@ In addition to auto traits, `WellFormed` predicates are co-inductive.
212212
These are used to achieve a similar "enumerate all the cases" pattern,
213213
as described in the section on [implied bounds].
214214

215-
[implied bounds]: ./traits/lowering-rules.html#implied-bounds
215+
[implied bounds]: ./lowering-rules.html#implied-bounds
216216

217217
## Incomplete chapter
218218

0 commit comments

Comments
 (0)