In my VSCode IDE (rust + rust-analyzer),
let v = vec![1, 2, 3];
for x in v.iter() {
println!("{}", x);
}
the above codes can't show Auto-Type Hints correctly (while most other hints work well), but several weeks ago they did. The problems are:
let v = vec![1, 2, 3];Type hinting doesn't work forv. When the mouse is moved uponv, it showslet v: {unknown}
v.iter()I can't find the methoditer()in the autocomplete list after typingv.However,into_iter()exists in the list.
for x in v.iter()Type hinting doesn't work forx, even if I explicitly announcev : Vec<u8> = vec![1,2,3];Therefore, I can't use the auto-hinted methods forx.
How to fix these problems?
Versions I used are the latest (by 2022-05-17):
code : 1.67.1-1651841865
rust : nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.63.0-nightly (4c5f6e627 2022-05-17)
rust-analyzer : v0.3.1059

