by xorvoid · 4y ago · 0 comments
Why is this problematic? (I presume there is a fatal flaw as it seems too obvious of a solution..)
Indeed, there’s an open issue for it:
https://github.com/rust-lang/rust/issues/54987
But there are a lot of desired features with open issues, so don’t expect this to be implemented anytime soon unless someone takes an interest in it.
Data dat;
dat.a = 1;
dat.b = “foobar”;
do_thing(&dat);
I seems like the compiler should be able to treat “dat” as an “maybe uninit” type until after “dat.b” gets assigned.