Surely Rust can infer the type in your example? It just doesn't provide Zig's syntax to use the inferred type to manually initialize. If you wrote some_fn() here where some_fn's return type was genericised, Rust would ask for the appropriately typed some_fn not say it doesn't know the type.
> Surely Rust can infer the type in your example?
Well in Rust code like this:
...I cannot write: ...even though the Rust compiler has all the type information it needs (from the 'left-hand-side').For comparison, in Zig it would look like this:
...Zig is still only halfway there compared to C99 (e.g. Zig doesn't allow designator chaining and is much less flexible for initializing nested arrays - in those areas it's closer to Rust than C).