Fix broken links related to `rustc_borrowck` (#1259)
* Fix broken links in region_inference.md * Fix broken links in lifetime_parameters.md
This commit is contained in:
parent
e1babf580d
commit
8047e19802
|
|
@ -5,7 +5,7 @@
|
|||
The MIR-based region checking code is located in [the `rustc_mir::borrow_check`
|
||||
module][nll].
|
||||
|
||||
[nll]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/index.html
|
||||
[nll]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/index.html
|
||||
|
||||
The MIR-based region analysis consists of two major functions:
|
||||
|
||||
|
|
@ -38,10 +38,10 @@ The MIR-based region analysis consists of two major functions:
|
|||
|
||||
[cp]: ./region_inference/constraint_propagation.md
|
||||
[fvb]: ../appendix/background.md#free-vs-bound
|
||||
[`replace_regions_in_mir`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/nll/fn.replace_regions_in_mir.html
|
||||
[`compute_regions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/nll/fn.compute_regions.html
|
||||
[`RegionInferenceContext`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/region_infer/struct.RegionInferenceContext.html
|
||||
[`solve`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/region_infer/struct.RegionInferenceContext.html#method.solve
|
||||
[`replace_regions_in_mir`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/nll/fn.replace_regions_in_mir.html
|
||||
[`compute_regions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/nll/fn.compute_regions.html
|
||||
[`RegionInferenceContext`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html
|
||||
[`solve`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#method.solve
|
||||
[NLL RFC]: https://rust-lang.github.io/rfcs/2094-nll.html
|
||||
[MIR type checker]: ./type_check.md
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ the moment.
|
|||
|
||||
TODO: write about _how_ these regions are computed.
|
||||
|
||||
[`UniversalRegions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/universal_regions/struct.UniversalRegions.html
|
||||
[`UniversalRegions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/universal_regions/struct.UniversalRegions.html
|
||||
|
||||
<a name="region-variables"></a>
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ common sorts of constraints are:
|
|||
2. Liveness constraints. Each region needs to be live at points where it can be
|
||||
used. These constraints are collected by [`generate_constraints`].
|
||||
|
||||
[`generate_constraints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/constraint_generation/fn.generate_constraints.html
|
||||
[`generate_constraints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/constraint_generation/fn.generate_constraints.html
|
||||
|
||||
## Inference Overview
|
||||
|
||||
|
|
@ -219,13 +219,13 @@ Here are some of the fields of the struct:
|
|||
- [`closure_bounds_mapping`]: used for propagating region constraints from
|
||||
closures back out to the creator of the closure.
|
||||
|
||||
[`constraints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/region_infer/struct.RegionInferenceContext.html#structfield.constraints
|
||||
[`liveness_constraints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/region_infer/struct.RegionInferenceContext.html#structfield.liveness_constraints
|
||||
[`constraints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#structfield.constraints
|
||||
[`liveness_constraints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#structfield.liveness_constraints
|
||||
[`location`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Location.html
|
||||
[`universal_regions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/region_infer/struct.RegionInferenceContext.html#structfield.universal_regions
|
||||
[`universal_region_relations`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/region_infer/struct.RegionInferenceContext.html#structfield.universal_region_relations
|
||||
[`type_tests`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/region_infer/struct.RegionInferenceContext.html#structfield.type_tests
|
||||
[`closure_bounds_mapping`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/region_infer/struct.RegionInferenceContext.html#structfield.closure_bounds_mapping
|
||||
[`universal_regions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#structfield.universal_regions
|
||||
[`universal_region_relations`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#structfield.universal_region_relations
|
||||
[`type_tests`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#structfield.type_tests
|
||||
[`closure_bounds_mapping`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#structfield.closure_bounds_mapping
|
||||
|
||||
TODO: should we discuss any of the others fields? What about the SCCs?
|
||||
|
||||
|
|
@ -234,6 +234,6 @@ inference. This is done by calling the [`solve`] method on the context. This
|
|||
is where we call [`propagate_constraints`] and then check the resulting type
|
||||
tests and universal regions, as discussed above.
|
||||
|
||||
[`propagate_constraints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/region_infer/struct.RegionInferenceContext.html#method.propagate_constraints
|
||||
[`check_type_tests`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/region_infer/struct.RegionInferenceContext.html#method.check_type_tests
|
||||
[`check_universal_regions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/region_infer/struct.RegionInferenceContext.html#method.check_universal_regions
|
||||
[`propagate_constraints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#method.propagate_constraints
|
||||
[`check_type_tests`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#method.check_type_tests
|
||||
[`check_universal_regions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#method.check_universal_regions
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ relationships to one another. So if you have e.g. `where 'a: 'b`, then
|
|||
the [`UniversalRegionRelations`] struct would track that `'a: 'b` is
|
||||
known to hold (which could be tested with the [`outlives`] function.
|
||||
|
||||
[`UniversalRegions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_borrowck/universal_regions/struct.UniversalRegions.html
|
||||
[`UniversalRegionRelations`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_borrowck/type_check/free_region_relations/struct.UniversalRegionRelations.html
|
||||
[`outlives`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_borrowck/type_check/free_region_relations/struct.UniversalRegionRelations.html#method.outlives
|
||||
[`UniversalRegions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/universal_regions/struct.UniversalRegions.html
|
||||
[`UniversalRegionRelations`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/type_check/free_region_relations/struct.UniversalRegionRelations.html
|
||||
[`outlives`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/type_check/free_region_relations/struct.UniversalRegionRelations.html#method.outlives
|
||||
|
||||
## Everything is a region variable
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ type). These subdivisions are not important for the topics discussed
|
|||
here, but become important when we consider [closure constraint
|
||||
propagation](./closure_constraints.html), so we discuss them there.
|
||||
|
||||
[`RegionClassification`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_borrowck/universal_regions/enum.RegionClassification.html#variant.Local
|
||||
[`RegionClassification`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/universal_regions/enum.RegionClassification.html#variant.Local
|
||||
|
||||
## Universal lifetimes as the elements of a region's value
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ liveness constraint (i.e., `'a` must extend until the end of
|
|||
itself). In the code, these liveness constraints are setup in
|
||||
[`init_free_and_bound_regions`].
|
||||
|
||||
[`init_free_and_bound_regions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_borrowck/region_infer/struct.RegionInferenceContext.html#method.init_free_and_bound_regions
|
||||
[`init_free_and_bound_regions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#method.init_free_and_bound_regions
|
||||
|
||||
## Propagating outlives constraints for universal regions
|
||||
|
||||
|
|
@ -124,4 +124,4 @@ not, as in our example, that is an error. This check is done in the
|
|||
universal regions, inspects their final value, and tests against the
|
||||
declared [`UniversalRegionRelations`].
|
||||
|
||||
[`check_universal_regions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_borrowck/region_infer/struct.RegionInferenceContext.html#method.check_universal_regions
|
||||
[`check_universal_regions`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/region_infer/struct.RegionInferenceContext.html#method.check_universal_regions
|
||||
|
|
|
|||
Loading…
Reference in New Issue