Skip to content

Commit c0851bc

Browse files
committed
fix remaining links
1 parent 55883c4 commit c0851bc

12 files changed

+40
-40
lines changed

src/SUMMARY.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- [Higher-ranked trait bounds](./traits/hrtb.md)
2727
- [Caching subtleties](./traits/caching.md)
2828
- [Specialization](./traits/specialization.md)
29-
- [Trait solving (new-style)](./traits.md)
29+
- [Trait solving (new-style)](./traits/index.md)
3030
- [Lowering to logic](./traits/lowering-to-logic.md)
3131
- [Goals and clauses](./traits/goals-and-clauses.md)
3232
- [Equality and associated types](./traits/associated-types.md)
@@ -38,12 +38,12 @@
3838
- [The lowering module in rustc](./traits/lowering-module.md)
3939
- [Well-formedness checking](./traits/wf.md)
4040
- [The SLG solver](./traits/slg.md)
41-
- [An Overview of Chalk](./chalk-overview.md)
41+
- [An Overview of Chalk](./traits/chalk-overview.md)
4242
- [Bibliography](./traits/bibliography.md)
4343
- [Type checking](./type-checking.md)
4444
- [Method Lookup](./method-lookup.md)
4545
- [Variance](./variance.md)
46-
- [The MIR (Mid-level IR)](./mir.md)
46+
- [The MIR (Mid-level IR)](./mir/index.md)
4747
- [MIR construction](./mir/construction.md)
4848
- [MIR visitor and traversal](./mir/visitor.md)
4949
- [MIR passes: getting the MIR for a function](./mir/passes.md)

src/appendix/glossary.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ them better.
77
Term | Meaning
88
------------------------|--------
99
AST | the abstract syntax tree produced by the syntax crate; reflects user syntax very closely.
10-
binder | a "binder" is a place where a variable or type is declared; for example, the `<T>` is a binder for the generic type parameter `T` in `fn foo<T>(..)`, and \|`a`\|` ...` is a binder for the parameter `a`. See [the background chapter for more](./appendix-background.html#free-vs-bound)
11-
bound variable | a "bound variable" is one that is declared within an expression/term. For example, the variable `a` is bound within the closure expession \|`a`\|` a * 2`. See [the background chapter for more](./appendix-background.html#free-vs-bound)
10+
binder | a "binder" is a place where a variable or type is declared; for example, the `<T>` is a binder for the generic type parameter `T` in `fn foo<T>(..)`, and \|`a`\|` ...` is a binder for the parameter `a`. See [the background chapter for more](./appendix/background.html#free-vs-bound)
11+
bound variable | a "bound variable" is one that is declared within an expression/term. For example, the variable `a` is bound within the closure expession \|`a`\|` a * 2`. See [the background chapter for more](./appendix/background.html#free-vs-bound)
1212
codegen unit | when we produce LLVM IR, we group the Rust code into a number of codegen units. Each of these units is processed by LLVM independently from one another, enabling parallelism. They are also the unit of incremental re-use.
1313
completeness | completeness is a technical term in type theory. Completeness means that every type-safe program also type-checks. Having both soundness and completeness is very hard, and usually soundness is more important. (see "soundness").
14-
control-flow graph | a representation of the control-flow of a program; see [the background chapter for more](./appendix-background.html#cfg)
14+
control-flow graph | a representation of the control-flow of a program; see [the background chapter for more](./appendix/background.html#cfg)
1515
cx | we tend to use "cx" as an abbrevation for context. See also `tcx`, `infcx`, etc.
1616
DAG | a directed acyclic graph is used during compilation to keep track of dependencies between queries. ([see more](incremental-compilation.html))
17-
data-flow analysis | a static analysis that figures out what properties are true at each point in the control-flow of a program; see [the background chapter for more](./appendix-background.html#dataflow)
17+
data-flow analysis | a static analysis that figures out what properties are true at each point in the control-flow of a program; see [the background chapter for more](./appendix/background.html#dataflow)
1818
DefId | an index identifying a definition (see `librustc/hir/def_id.rs`). Uniquely identifies a `DefPath`.
1919
Double pointer | a pointer with additional metadata. See "fat pointer" for more.
2020
Fat pointer | a two word value carrying the address of some value, along with some further information necessary to put the value to use. Rust includes two kinds of "fat pointers": references to slices, and trait objects. A reference to a slice carries the starting address of the slice and its length. A trait object carries a value's address and a pointer to the trait's implementation appropriate to that value. "Fat pointers" are also known as "wide pointers", and "double pointers".
21-
free variable | a "free variable" is one that is not bound within an expression or term; see [the background chapter for more](./appendix-background.html#free-vs-bound)
21+
free variable | a "free variable" is one that is not bound within an expression or term; see [the background chapter for more](./appendix/background.html#free-vs-bound)
2222
'gcx | the lifetime of the global arena ([see more](ty.html))
2323
generics | the set of generic type parameters defined on a type or item
2424
HIR | the High-level IR, created by lowering and desugaring the AST ([see more](hir.html))
@@ -32,36 +32,36 @@ IR | Intermediate Representation. A general term in compil
3232
local crate | the crate currently being compiled.
3333
LTO | Link-Time Optimizations. A set of optimizations offered by LLVM that occur just before the final binary is linked. These include optmizations like removing functions that are never used in the final program, for example. _ThinLTO_ is a variant of LTO that aims to be a bit more scalable and efficient, but possibly sacrifices some optimizations. You may also read issues in the Rust repo about "FatLTO", which is the loving nickname given to non-Thin LTO. LLVM documentation: [here][lto] and [here][thinlto]
3434
[LLVM] | (actually not an acronym :P) an open-source compiler backend. It accepts LLVM IR and outputs native binaries. Various languages (e.g. Rust) can then implement a compiler front-end that output LLVM IR and use LLVM to compile to all the platforms LLVM supports.
35-
MIR | the Mid-level IR that is created after type-checking for use by borrowck and trans ([see more](./mir.html))
35+
MIR | the Mid-level IR that is created after type-checking for use by borrowck and trans ([see more](./mir/index.html))
3636
miri | an interpreter for MIR used for constant evaluation ([see more](./miri.html))
37-
normalize | a general term for converting to a more canonical form, but in the case of rustc typically refers to [associated type normalization](./traits-associated-types.html#normalize)
37+
normalize | a general term for converting to a more canonical form, but in the case of rustc typically refers to [associated type normalization](./traits/associated-types.html#normalize)
3838
newtype | a "newtype" is a wrapper around some other type (e.g., `struct Foo(T)` is a "newtype" for `T`). This is commonly used in Rust to give a stronger type for indices.
39-
NLL | [non-lexical lifetimes](./mir-regionck.html), an extension to Rust's borrowing system to make it be based on the control-flow graph.
39+
NLL | [non-lexical lifetimes](./mir/regionck.html), an extension to Rust's borrowing system to make it be based on the control-flow graph.
4040
node-id or NodeId | an index identifying a particular node in the AST or HIR; gradually being phased out and replaced with `HirId`.
41-
obligation | something that must be proven by the trait system ([see more](trait-resolution.html))
42-
projection | a general term for a "relative path", e.g. `x.f` is a "field projection", and `T::Item` is an ["associated type projection"](./traits-goals-and-clauses.html#trait-ref)
43-
promoted constants | constants extracted from a function and lifted to static scope; see [this section](./mir.html#promoted) for more details.
41+
obligation | something that must be proven by the trait system ([see more](traits/resolution.html))
42+
projection | a general term for a "relative path", e.g. `x.f` is a "field projection", and `T::Item` is an ["associated type projection"](./traits/goals-and-clauses.html#trait-ref)
43+
promoted constants | constants extracted from a function and lifted to static scope; see [this section](./mir/index.html#promoted) for more details.
4444
provider | the function that executes a query ([see more](query.html))
45-
quantified | in math or logic, existential and universal quantification are used to ask questions like "is there any type T for which is true?" or "is this true for all types T?"; see [the background chapter for more](./appendix-background.html#quantified)
45+
quantified | in math or logic, existential and universal quantification are used to ask questions like "is there any type T for which is true?" or "is this true for all types T?"; see [the background chapter for more](./appendix/background.html#quantified)
4646
query | perhaps some sub-computation during compilation ([see more](query.html))
4747
region | another term for "lifetime" often used in the literature and in the borrow checker.
4848
sess | the compiler session, which stores global data used throughout compilation
4949
side tables | because the AST and HIR are immutable once created, we often carry extra information about them in the form of hashtables, indexed by the id of a particular node.
5050
sigil | like a keyword but composed entirely of non-alphanumeric tokens. For example, `&` is a sigil for references.
51-
skolemization | a way of handling subtyping around "for-all" types (e.g., `for<'a> fn(&'a u32)`) as well as solving higher-ranked trait bounds (e.g., `for<'a> T: Trait<'a>`). See [the chapter on skolemization and universes](./mir-regionck.html#skol) for more details.
51+
skolemization | a way of handling subtyping around "for-all" types (e.g., `for<'a> fn(&'a u32)`) as well as solving higher-ranked trait bounds (e.g., `for<'a> T: Trait<'a>`). See [the chapter on skolemization and universes](./mir/regionck.html#skol) for more details.
5252
soundness | soundness is a technical term in type theory. Roughly, if a type system is sound, then if a program type-checks, it is type-safe; i.e. I can never (in safe rust) force a value into a variable of the wrong type. (see "completeness").
5353
span | a location in the user's source code, used for error reporting primarily. These are like a file-name/line-number/column tuple on steroids: they carry a start/end point, and also track macro expansions and compiler desugaring. All while being packed into a few bytes (really, it's an index into a table). See the Span datatype for more.
5454
substs | the substitutions for a given generic type or item (e.g. the `i32`, `u32` in `HashMap<i32, u32>`)
5555
tcx | the "typing context", main data structure of the compiler ([see more](ty.html))
5656
'tcx | the lifetime of the currently active inference context ([see more](ty.html))
57-
trait reference | the name of a trait along with a suitable set of input type/lifetimes ([see more](./traits-goals-and-clauses.html#trait-ref))
57+
trait reference | the name of a trait along with a suitable set of input type/lifetimes ([see more](./traits/goals-and-clauses.html#trait-ref))
5858
token | the smallest unit of parsing. Tokens are produced after lexing ([see more](the-parser.html)).
5959
[TLS] | Thread-Local Storage. Variables may be defined so that each thread has its own copy (rather than all threads sharing the variable). This has some interactions with LLVM. Not all platforms support TLS.
6060
trans | the code to translate MIR into LLVM IR.
6161
trait reference | a trait and values for its type parameters ([see more](ty.html)).
6262
ty | the internal representation of a type ([see more](ty.html)).
6363
UFCS | Universal Function Call Syntax. An unambiguous syntax for calling a method ([see more](type-checking.html)).
64-
variance | variance determines how changes to a generic type/lifetime parameter affect subtyping; for example, if `T` is a subtype of `U`, then `Vec<T>` is a subtype `Vec<U>` because `Vec` is *covariant* in its generic parameter. See [the background chapter](./appendix-background.html#variance) for a more general explanation. See the [variance chapter](./variance.html) for an explanation of how type checking handles variance.
64+
variance | variance determines how changes to a generic type/lifetime parameter affect subtyping; for example, if `T` is a subtype of `U`, then `Vec<T>` is a subtype `Vec<U>` because `Vec` is *covariant* in its generic parameter. See [the background chapter](./appendix/background.html#variance) for a more general explanation. See the [variance chapter](./variance.html) for an explanation of how type checking handles variance.
6565
Wide pointer | a pointer with additional metadata. See "fat pointer" for more.
6666

6767
[LLVM]: https://llvm.org/

src/mir/borrowck.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Doing borrow checking on MIR has two key advantages:
2121
can see
2222
[a list of bugs that the MIR-based borrow checker fixes here][47366].)
2323
- Even more importantly, using the MIR enables ["non-lexical lifetimes"][nll],
24-
which are regions derived from the control-flow graph.
24+
which are regions derived from the control-flow graph.
2525

2626
[47366]: https://github.com/rust-lang/rust/issues/47366
2727
[nll]: http://rust-lang.github.io/rfcs/2094-nll.html
@@ -43,17 +43,17 @@ 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](./mir/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](./mir/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
5858
at any particular point.
59-
59+

src/mir/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -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

+1-1
Original file line numberDiff line numberDiff line change
@@ -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]: mir/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/traits/canonicalization.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -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

src/chalk-overview.md renamed to src/traits/chalk-overview.md

+5-5
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]: traits/lowering-to-logic.html
135+
[lowering-rules]: traits/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]: https://rust-lang-nursery.github.io/rustc-guide/traits-lowering-to-logic.html#type-checking-generic-functions-beyond-horn-clauses
139+
[lowering-forall]: ./traits/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]: ./traits/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
145145
[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]: ./traits/slg.html

0 commit comments

Comments
 (0)