You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using edition 2021, should at least compile (it does without the specifications), but the closure's spec causes a borrow error:
error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable
--> /.../test.rs:5:42
|
4 | let p0 = &p.0;
| ---- immutable borrow occurs here
5 | let mut clos = #[ensures(p.1@ == 1)] || {
| --- ^^ mutable borrow occurs here
| |
| second borrow occurs due to use of `p` in closure
6 | p.1 = 1;
| --- capture is mutable because of use here
...
10 | *p0 + p.1
| --- immutable borrow later used here
The text was updated successfully, but these errors were encountered:
The following code:
When using edition 2021, should at least compile (it does without the specifications), but the closure's spec causes a borrow error:
The text was updated successfully, but these errors were encountered: