4 ms·
Rust already supports partially deinitialized structs - that is, moving out of a struct field by field - and there’s no fundamental reason it can’t support part
by comex 5y ago
Rust already supports partially deinitialized structs - that is, moving out of a struct field by field - and there’s no fundamental reason it can’t support partial initialization too.
Indeed, there’s an open issue for it:
https://github.com/rust-lang/rust/issues/54987 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.
- xorvoid 5y agoAh okay this makes sense. I wish I personally had the spare time to contribute this.