cannot use `state` because it was mutably borrowed
Closed this issue · 0 comments
soc1c commented
~/.opt/parity-bitcoin master
❯ cargo build --release
Compiling getopts v0.2.15
Compiling linked-hash-map v0.4.2
Compiling slab v0.4.0
Compiling serde v1.0.21
Compiling quick-error v1.2.1
Compiling utf8-ranges v1.0.0
error[E0503]: cannot use `state` because it was mutably borrowed
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/getopts-0.2.15/src/lib.rs:1033:33
|
978 | let mut machine = |cont: &mut bool, (i, c): (usize, char)| {
| ---------------------------------------- borrow of `state` occurs here
...
982 | state = match (state, whitespace, limit) {
| ----- borrow occurs due to use of `state` in closure
...
1033 | while cont && match state { B | C => true, A => false } {
| ^ use of borrowed `state`
1034 | machine(&mut cont, (fake_i, ' '));
| ------- borrow later used here
error: aborting due to previous error
For more information about this error, try `rustc --explain E0503`.
error: Could not compile `getopts`.
warning: build failed, waiting for other jobs to finish...
error: build failed
~/.opt/parity-bitcoin master 7s
❯ git log -n1
commit d70cf432537ad0a595bfb5d20b22fde98fe47da6 (HEAD -> master, origin/master, origin/HEAD)
Merge: 40c3b37 a089130
Author: Nikolay Volf <nikvolf@gmail.com>
Date: Tue Oct 1 11:32:13 2019 +0300
Merge pull request #566 from D3v3sh5ingh/patch-1
fixed typos and improved documentation
~/.opt/parity-bitcoin master
❯ uname -a
Linux host 5.3.1-arch1-1-ARCH #1 SMP PREEMPT Sat Sep 21 11:33:49 UTC 2019 x86_64 GNU/Linux
~/.opt/parity-bitcoin master
❯ rustc --version
rustc 1.38.0 (625451e37 2019-09-23)