The following code compiles fine but Intellij is complaining with Cannot move. Is this a bug in Intellij?
use std::collections::HashMap;
struct Tester {
tree: HashMap<usize, State>,
}
struct State {
count: usize,
}
fn get_count(tester: Tester) -> usize {
tester.tree.get(&0).unwrap().count
}
Simpler example
use std::collections::HashMap;
struct Tester {
tree: HashMap<usize, usize>,
}
fn get_count(tester: Tester) -> usize {
*tester.tree.get(&0).unwrap()
}
leob
3
Did you already try invalidating the caches using File | Invalidate Caches and restarting the editor?
Are you using Rust nightly? I've run into this as well, and it looks like it's recently fixed: copy type report error: Use of moved value · Issue #10427 · intellij-rust/intellij-rust · GitHub.
Yes I did that as well as reinstalling the plugin
Yes great, the nightly build of the plugin solves this problem
Thnxs
system
Closed
8
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.