]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // Test that an unboxed closure that mutates a free variable will |
2 | // cause borrow conflicts. | |
223e47cc | 3 | |
b7449926 XL |
4 | |
5 | ||
223e47cc | 6 | fn main() { |
c34b1796 | 7 | let mut x = 0; |
85aaf69f | 8 | let f = || x += 1; |
1a4d82fc | 9 | let _y = x; //~ ERROR cannot use `x` because it was mutably borrowed |
b7449926 | 10 | f; |
223e47cc | 11 | } |