fix links
This commit is contained in:
parent
13af334f2d
commit
b32b9ae934
|
|
@ -11,7 +11,7 @@ on one at a time (each of them is fairly independent from the others):
|
||||||
- [member constraints][m_c] (`member R_m of [R_c...]`), which arise from impl Trait.
|
- [member constraints][m_c] (`member R_m of [R_c...]`), which arise from impl Trait.
|
||||||
|
|
||||||
[`propagate_constraints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/nll/region_infer/struct.RegionInferenceContext.html#method.propagate_constraints
|
[`propagate_constraints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/nll/region_infer/struct.RegionInferenceContext.html#method.propagate_constraints
|
||||||
[m_c]: ./member_constraints.html
|
[m_c]: ./member_constraints.md
|
||||||
|
|
||||||
In this chapter, we'll explain the "heart" of constraint propagation,
|
In this chapter, we'll explain the "heart" of constraint propagation,
|
||||||
covering both liveness and outlives constraints.
|
covering both liveness and outlives constraints.
|
||||||
|
|
@ -29,7 +29,7 @@ given some set of constraints `{C}` and it computes a set of values
|
||||||
- For each constraint C:
|
- For each constraint C:
|
||||||
- Update `Values` as needed to satisfy the constraint
|
- Update `Values` as needed to satisfy the constraint
|
||||||
|
|
||||||
[riv]: ../region-inference.html#region-variables
|
[riv]: ../region_inference.md#region-variables
|
||||||
|
|
||||||
As a simple example, if we have a liveness constraint `R live at E`,
|
As a simple example, if we have a liveness constraint `R live at E`,
|
||||||
then we can apply `Values(R) = Values(R) union {E}` to make the
|
then we can apply `Values(R) = Values(R) union {E}` to make the
|
||||||
|
|
@ -55,7 +55,7 @@ includes a region R is live at some [point] P. This simply means that
|
||||||
the value of R must include the point P. Liveness constraints are
|
the value of R must include the point P. Liveness constraints are
|
||||||
computed by the MIR type checker.
|
computed by the MIR type checker.
|
||||||
|
|
||||||
[point]: ../../appendix/glossary.html
|
[point]: ../../appendix/glossary.md
|
||||||
|
|
||||||
A liveness constraint `R live at E` is satisfied if `E` is a member of
|
A liveness constraint `R live at E` is satisfied if `E` is a member of
|
||||||
`Values(R)`. So to "apply" such a constraint to `Values`, we just have
|
`Values(R)`. So to "apply" such a constraint to `Values`, we just have
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ the type of `foo` the type `bar` expects
|
||||||
|
|
||||||
We handle this sort of subtyping by taking the variables that are
|
We handle this sort of subtyping by taking the variables that are
|
||||||
bound in the supertype and replacing them with
|
bound in the supertype and replacing them with
|
||||||
[universally quantified](../appendix/background.html#quantified)
|
[universally quantified](../../appendix/background.md#quantified)
|
||||||
representatives, denoted like `!1` here. We call these regions "placeholder
|
representatives, denoted like `!1` here. We call these regions "placeholder
|
||||||
regions" – they represent, basically, "some unknown region".
|
regions" – they represent, basically, "some unknown region".
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ what we wanted.
|
||||||
|
|
||||||
So let's work through what happens next. To check if two functions are
|
So let's work through what happens next. To check if two functions are
|
||||||
subtypes, we check if their arguments have the desired relationship
|
subtypes, we check if their arguments have the desired relationship
|
||||||
(fn arguments are [contravariant](../appendix/background.html#variance), so
|
(fn arguments are [contravariant](../../appendix/background.md#variance), so
|
||||||
we swap the left and right here):
|
we swap the left and right here):
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
|
@ -92,7 +92,7 @@ Here, the root universe would consist of the lifetimes `'static` and
|
||||||
the same concept to types, in which case the types `Foo` and `T` would
|
the same concept to types, in which case the types `Foo` and `T` would
|
||||||
be in the root universe (along with other global types, like `i32`).
|
be in the root universe (along with other global types, like `i32`).
|
||||||
Basically, the root universe contains all the names that
|
Basically, the root universe contains all the names that
|
||||||
[appear free](../appendix/background.html#free-vs-bound) in the body of `bar`.
|
[appear free](../../appendix/background.md#free-vs-bound) in the body of `bar`.
|
||||||
|
|
||||||
Now let's extend `bar` a bit by adding a variable `x`:
|
Now let's extend `bar` a bit by adding a variable `x`:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue