about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2024-12-23 10:17:51 +0100
committerGitHub <noreply@github.com>2024-12-23 10:17:51 +0100
commitedd2a9bc392ec1c30f4d92d0e348e3d953e92837 (patch)
tree07fddb4f8925bdf36c7b4586441b662dcba9aed0
parent444d0d765d8b6ad3f2618fcd4c0fa315cb7ccfff (diff)
downloadrust-edd2a9bc392ec1c30f4d92d0e348e3d953e92837.tar.gz
rust-edd2a9bc392ec1c30f4d92d0e348e3d953e92837.zip
region-outlives propagation (#2169)
* region-outlives propagation

* woops

* gamer
-rw-r--r--src/doc/rustc-dev-guide/src/borrow_check/region_inference/closure_constraints.md6
1 files changed, 5 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 b4efd266191..be279b773cf 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
@@ -15,7 +15,11 @@ While borrow-checking a closure inside of `RegionInferenceContext::solve` we sep
 
 ### Region-outlive constraints
 
-If we fail to prove a region-outlives constraint, we try to propagate it in `fn try_propagate_universal_region_error`.
+If `RegionInferenceContext::check_universal_regions` fails to prove some outlives constraint `'longer_fr: 'shorter_fr`, we try to propagate it in `fn try_propagate_universal_region_error`. Both these universal regions are either local to the closure or an external region.
+
+In case `'longer_fr` is a local universal region, we search for the largest external region `'fr_minus` which is outlived by `'longer_fr`, i.e. `'longer_fr: 'fr_minus`. In case there are multiple such regions, we pick the `mutual_immediate_postdominator`: the fixpoint of repeatedly computing the GLB of all GLBs, see [TransitiveRelation::postdom_upper_bound](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_data_structures/transitive_relation/struct.TransitiveRelation.html#method.postdom_upper_bound) for more details.
+
+If `'fr_minus` exists we require it to outlive all non-local upper bounds of `'shorter_fr`. There will always be at least one non-local upper bound `'static`.
 
 ### Type-outlive constraints