You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[derive(Debug)]structValue;#[derive(Default)]structContainer{map:HashMap<u64,Value>,}#[test]fntest(){letmut container = Container::default();
container.map.insert(0,Value);let value = container.map.get(&0);println!("{:?}", value);}
description: In the code above, rust-analyzer cannot determine the type of the value variable and the map field of the container variable, showing {unknown} for both.
However, if I give a type signature for value manually as follows, no errors will be reported, and rust-analyzer will present fields and methods of value in a correct way.
let value:Option<&Value> = container.map.get(&0);println!("{:?}", value);
The text was updated successfully, but these errors were encountered:
rust-analyzer version: rust-analyzer version: 0.4.1960-standalone
rustc version: rustc 1.77.0-nightly (7ffc697ce 2024-01-24)
editor or extension: VSCode
relevant settings:
code snippet to reproduce:
description: In the code above, rust-analyzer cannot determine the type of the
value
variable and the map field of thecontainer
variable, showing{unknown}
for both.However, if I give a type signature for
value
manually as follows, no errors will be reported, and rust-analyzer will present fields and methods ofvalue
in a correct way.The text was updated successfully, but these errors were encountered: