]> git.lizzy.rs Git - rust.git/commitdiff
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)
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

1  2 
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

Simple merge
Simple merge