In the C++ runtime if a type has a requires clause and that field is used in determining the size of the struct, IsComplete appears to check that requires clause. This means a generic approach of 0-initializing a buffer then checking IsComplete breaks for structs that have fields that exclude 0, for instance.
Workarounds involve either leaving it unchecked and manually confirming (defeating the purpose of checks like IsComplete) or splitting definitions into fixed-size portions and variable-sized portions.
We should evaluate whether IsComplete should ignore the requires for these fields, or if there's a good reason we need to ensure the consistency of these fields, potentially provide a verifier that ensures that all fixed-size, fixed-location portions of the struct are safe to write to, allowing the client code to call IsComplete once they've initialized those to ensure the entire struct is safe to write to.
In the C++ runtime if a type has a
requiresclause and that field is used in determining the size of the struct,IsCompleteappears to check thatrequiresclause. This means a generic approach of 0-initializing a buffer then checkingIsCompletebreaks for structs that have fields that exclude 0, for instance.Workarounds involve either leaving it unchecked and manually confirming (defeating the purpose of checks like
IsComplete) or splitting definitions into fixed-size portions and variable-sized portions.We should evaluate whether
IsCompleteshould ignore therequiresfor these fields, or if there's a good reason we need to ensure the consistency of these fields, potentially provide a verifier that ensures that all fixed-size, fixed-location portions of the struct are safe to write to, allowing the client code to callIsCompleteonce they've initialized those to ensure the entire struct is safe to write to.