]> git.lizzy.rs Git - rust.git/commit
Auto merge of #45668 - nikomatsakis:nll-free-region, r=arielb1
authorbors <bors@rust-lang.org>
Mon, 6 Nov 2017 23:30:57 +0000 (23:30 +0000)
committerbors <bors@rust-lang.org>
Mon, 6 Nov 2017 23:30:57 +0000 (23:30 +0000)
commit785643a5eb6727d788b218e10ce60219b1c3c27f
treec2e071a6e9a6d1e5ded1ce781dace6eda4d4dc14
parentbd0e45a323f85a1940d997ac237023c00670da67
parent7b4282e02bdff3b91c4a317af94ce18149044830
Auto merge of #45668 - nikomatsakis:nll-free-region, r=arielb1

extend NLL with preliminary support for free regions on functions

This PR extends https://github.com/rust-lang/rust/pull/45538 with support for free regions. This is pretty preliminary and will no doubt want to change in various ways, particularly as we add support for closures, but it's enough to get the basic idea in place:

- We now create specific regions to represent each named lifetime declared on the function.
- Region values can contain references to these regions (represented for now as a `BTreeSet<RegionIndex>`).
- If we wind up trying to infer that `'a: 'b` must hold, but no such relationship was declared, we report an error.

It also does a number of drive-by refactorings.

r? @arielb1

cc @spastorino
src/librustc/infer/error_reporting/mod.rs
src/librustc/mir/visit.rs
src/librustc_mir/transform/type_check.rs
src/librustc_passes/mir_stats.rs