Closed
Description
Example asked about on IRC:
[f32; 2]::deserialize(deserializer).map(|arr| Location { lat: arr[0], lon: arr[1] })
Simple repro:
fn main() {
let a = [1, 2, 3];
let _ = [i32; 3]::clone(&a);
}
Current error:
error: expected one of `.`, `;`, `?`, or an operator, found `::`
--> <anon>:3:20
|
3 | let _ = [i32;3]::clone(&a);
| ^^ expected one of `.`, `;`, `?`, or an operator here
The direct solution (<[f32; 2]>::deserialize
) is non-obvious and hard to search for, so the compiler could be particularly helpful here.