rustc: collect upvars from HIR, instead of during name resolution.
This commit is contained in:
parent
648b4d884d
commit
f7a4c9d7b5
12 changed files with 143 additions and 97 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue