]> git.lizzy.rs Git - rust.git/commit
replace constant regions with a post-inference check
authorNiko Matsakis <niko@alum.mit.edu>
Fri, 10 Nov 2017 11:04:49 +0000 (06:04 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Mon, 4 Dec 2017 13:25:21 +0000 (08:25 -0500)
commita96b0cf86df86c9b9f9bbc5a24d06e4304bc871d
treebdb627f26f36e7f59705b3420c9f7e8f4fcfc187
parent932452ecc7f0a8ab8ad678a343d828385de80e1a
replace constant regions with a post-inference check

Rather than declaring some region variables to be constant, and
reporting errors when they would have to change, we instead populate
each free region X with a minimal set of points (the CFG plus end(X)),
and then we let inference do its thing. This may add other `end(Y)`
points into X; we can then check after the fact that indeed `X: Y`
holds.

This requires a bit of "blame" detection to find where the bad
constraint came from: we are currently using a pretty dumb
algorithm. Good place for later expansion.
src/librustc/middle/free_region.rs
src/librustc_mir/transform/nll/region_infer.rs
src/test/mir-opt/nll/named-lifetimes-basic.rs