Skip to content

Commit ba3d623

Browse files
committed
cool
1 parent d96eef9 commit ba3d623

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: src/borrow_check/region_inference/closure_constraints.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ they hold, we report an error.
1111

1212
## How this is implemented
1313

14-
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.
14+
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.
15+
16+
### Region-outlive constraints
17+
18+
If we fail to prove a region-outlives constraint, we try to propagate it in `fn try_propagate_universal_region_error`.
19+
20+
### Type-outlive constraints
21+
22+
Type-outlives constraints are proven in `check_type_tests`. This happens after computing the outlives graph, which is now immutable.
1523

1624
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`.
1725

0 commit comments

Comments
 (0)