_ can only be used in two contexts: in templates to match the value to ignore and as a placeholder for the type. In array types, length is not a type, but expression and _ cannot be used in expressions.
However, you can add f32 only one of the literals and completely omit the type. Since all elements of the array must have the same type, the compiler will infer the correct element type for the array.
let a = [0.0f32, 1.0, 2.0];
Francis gagné
source share