diff options
| author | lcnr <rust@lcnr.de> | 2024-12-05 13:30:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-05 20:30:36 +0800 |
| commit | 7c85a99e80c1f3fc9075d0523801c8a9c7714310 (patch) | |
| tree | 09951536159c9784e192660ee91ad0a85934618c /src/doc/rustc-dev-guide | |
| parent | f96f76a62d5452dd80002efe23cc27aab2fdd05e (diff) | |
| download | rust-7c85a99e80c1f3fc9075d0523801c8a9c7714310.tar.gz rust-7c85a99e80c1f3fc9075d0523801c8a9c7714310.zip | |
update section even more (#2156)
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/borrow_check/region_inference/closure_constraints.md | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/doc/rustc-dev-guide/src/borrow_check/region_inference/closure_constraints.md b/src/doc/rustc-dev-guide/src/borrow_check/region_inference/closure_constraints.md index d2f7f377e5b..b4efd266191 100644 --- a/src/doc/rustc-dev-guide/src/borrow_check/region_inference/closure_constraints.md +++ b/src/doc/rustc-dev-guide/src/borrow_check/region_inference/closure_constraints.md @@ -11,7 +11,15 @@ they hold, we report an error. ## How this is implemented -While borrow-checking a closure inside of `RegionInferenceContext::solve` we call `check_type_tests` with a list of `outlives_requirements` to propagate to the caller. This happens after computing the outlives graph, which is now immutable. +While borrow-checking a closure inside of `RegionInferenceContext::solve` we separately try to propagate type-outlives and region-outlives constraints to the parent if we're unable to prove them locally. + +### Region-outlive constraints + +If we fail to prove a region-outlives constraint, we try to propagate it in `fn try_propagate_universal_region_error`. + +### Type-outlive constraints + +Type-outlives constraints are proven in `check_type_tests`. This happens after computing the outlives graph, which is now immutable. For all type tests we fail to prove via `fn eval_verify_bound` inside of the closure we call `try_promote_type_test`. A `TypeTest` represents a type-outlives bound `generic_kind: lower_bound` together with a `verify_bound`. If the `VerifyBound` holds for the `lower_bound`, the constraint is satisfied. `try_promote_type_test` does not care about the ` verify_bound`. |
