Pre-RFC: Relaxed #[non_exhaustive] structs

The fact that it breaks code means that such change would require an edition boundary and a way / syntax to express the current semantics if the syntax were to be overriden with the semantics showcased by the macro.

Another option is to use a slightly different syntax for this new suggested behavior (which, imho, is more logical than that of copying each field when possible when a struct is not Copy itself). What about:

source = Options { a: Bool(true) .. move source };

Combined with .. } becoming sugar for .. move Default::default() }, it would enable what the OP wants, while letting existing code just be.

5 Likes