rustc: collect upvars from HIR, instead of during name resolution.

This commit is contained in:
Eduard-Mihai Burtescu 2019-05-28 23:31:01 +03:00
parent 648b4d884d
commit f7a4c9d7b5
12 changed files with 143 additions and 97 deletions

View file

@ -4,7 +4,7 @@ error[E0502]: cannot borrow `*ptr` as immutable because it is also borrowed as m
LL | let mut test = |foo: &Foo| {
| ----------- mutable borrow occurs here
LL | ptr = box Foo { x: ptr.x + 1 };
| --- first borrow occurs due to use of `ptr` in closure
| --- first borrow occurs due to use of `ptr` in closure
LL | };
LL | test(&*ptr);
| ---- ^^^^^ immutable borrow occurs here