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

@ -5,7 +5,7 @@ LL | let mut test = |foo: &Foo| {
| ----------- mutable borrow occurs here
LL | println!("access {}", foo.x);
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 | test(&*ptr);
| ---- ^^^^^ immutable borrow occurs here