Open oxalica opened 7 months ago
Hmm, vec![1u32, 2u32].try_into()
has type Result<[{unknown}], <Vec<u32, Global> as TryInto<[{unknown}]>>::Error>
here, adding the type ascription let [a, b]: [u32; 2] = vec![1u32, 2u32].try_into().unwrap();
makes us resolve the try_into
result correctly though
adding the type ascription
Yes. But rustc
can infer that without explicit type ascription.
Note: specifically, this feature is added since 1.73, in https://github.com/rust-lang/rust/pull/113199
I am aware, I was just trying to reduce the root problem. Oh thanks for that link, would make sense that we are missing that if its such a recent inference feature.
Types of
a
andb
in this code below cannot be inferred by rust-analyzer, but it compiles fine with rustc.rust-analyzer version: 2024-02-19
rustc version: rustc 1.76.0 (07dca489a 2024-02-04)
relevant settings: N/A