intellij-rust: Good code red: cannot move
Environment
- IntelliJ Rust plugin version: 0.3.132.3395-202
- Rust toolchain version: 1.47 stable
- IDE name and version: IntelliJ IDEA 2020.2.3
- Operating system: Linux Ubuntu 20.04
Problem description
With the recent upgrade of Rust plugin I see plenty of “cannot move” errors, despite the code compiling fine.
Minified example:
pub struct Mean {
pub value: f64,
pub std_err: f64,
}
pub fn t_test(mean1: &Mean, mean2: &Mean) -> f64 {
let v1 = mean1.value; // << mean1 underlined, "cannot move", despite f64 being Copy
let s1 = mean1.std_err; // << mean1 underlined, "cannot move", despite f64 being Copy
// ...
0.0
}
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 4
- Comments: 17 (3 by maintainers)
I appear to be having the same issue as well. @Undin Invalidating the caches and restarting IntelliJ hasn’t worked. This appears to be a valid bug since it’s also happening to me.
I got this bug with the last update. Invalidating caches does not help, purging
.idea/workspace.xml
fixes it. Did a bit more investigating, looks like this line within.idea/workspace.xml
was causing the issue:It is easy to reproduce this bug by array.
About CLion
@pkolaczk try to invalidate caches and restart IDE via
File | Invalidate Caches / Restart
action