Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are cases where
Default
cannot be derived for certain Windows types, but there are many more where it can and doing so improves readability and reduces code generation. This further builds on the likes of #2760, #3015, #3041, #3097, #3270 by derivingDefault
for structs that don't use the--sys
option, although I have had a request to extend it to--sys
code generation as well so I'll probably do that in a follow-up PR.Notably, Rust won't allow
Default
to be derived for structs with explicit layout or structs with pointer or array fields. These continue to be generated bywindows-bindgen
as before.