[Pre-RFC] Inferred struct initializer (2)

Can you elaborate why a macro-looking thing is the best syntax for this? Why is that better than, say, let object: S = .{ x: 10.0, y: 10.0 };?

It should fail with a type inference error, same as if you do let object = Default::default(); without constraining it.

You can actually do this today, albeit only in the ..default() form, using the macro in Pre-pre-RFC: syntactic sugar for `Default::default()` - #7 by scottmcm

2 Likes