NuxiNL/cloudabi

uninitialized is deprecated

Closed this issue · 3 comments

print(' let obj: {} = ::core::mem::uninitialized();'.format(

This line should likely be changed to use mem::zeroed() if I'm following correctly that these are C-like structs that are being initialized.

It is not currently defined to perform the reference and field access on the uninitialized memory too, whereas with zeroed this should be fine (at least as I understand it, though I cannot be 100% certain, as some of these details are still in flux).

mem::zeroed() doesn't seem ideal either, as some structs contain enums that don't have a 0 variant.

I'll try to change the generator to actually generate valid values in these tests.

Fixed! Published as cloudabi crate 0.1.0.

Thanks for the quick fix! I missed that there were some enums among them.