Unify the upvar variables found in closures with the actual types of the

upvars after analysis is done. Remove the `closure_upvars` helper and
just consult this list of type variables directly.
This commit is contained in:
Niko Matsakis 2015-07-17 08:22:03 -04:00
parent a551697134
commit 7ba288dced
12 changed files with 214 additions and 252 deletions

View file

@ -18,7 +18,7 @@ fn borrowed_proc<'a>(x: &'a isize) -> Box<FnMut()->(isize) + 'a> {
fn static_proc(x: &isize) -> Box<FnMut()->(isize) + 'static> {
// This is illegal, because the region bound on `proc` is 'static.
Box::new(move|| { *x }) //~ ERROR captured variable `x` does not outlive the enclosing closure
Box::new(move|| { *x }) //~ ERROR does not fulfill the required lifetime
}
fn main() { }