-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[derive] Support deriving on unsized types #122
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3a8ed95
to
e1d80f6
Compare
@djkoloski mind taking a look at this? It depends on #120, so I'll wait for that to merge before submitting this. |
14aaeaa
to
4f80bce
Compare
djkoloski
reviewed
Nov 6, 2022
4f80bce
to
62ea770
Compare
djkoloski
previously approved these changes
Nov 7, 2022
62ea770
to
40e9634
Compare
Hey @djkoloski , thanks for the review! After your review, I made a few substantive changes (mostly to tests). Can you take a look and let me know if everything still looks good to you? Here's the diff compared to what you reviewed. |
djkoloski
previously approved these changes
Nov 8, 2022
In order to test this support, add a new `Unsized` type in zerocopy's `test` module. Use this to test the derive and also to test `AsBytes`'s methods in `test_as_bytes_methods`. These tests supersede the previous unsized tests, which used slices, and have been removed. While we're here, expand `test_as_bytes_methods` to test the `write_to`, `write_to_prefix`, and `write_to_suffix` methods, which were not previously tested. Also in order to test this support, implement zerocopy traits for `PhantomData` and `ManuallyDrop` for unsized types. While we're here, add a new `test_impls` test to ensure that all expected zerocopy trait impls are emitted.
40e9634
to
86ef71e
Compare
joshlf
added a commit
that referenced
this pull request
Aug 3, 2023
In order to test this support, add a new `Unsized` type in zerocopy's `test` module. Use this to test the derive and also to test `AsBytes`'s methods in `test_as_bytes_methods`. These tests supersede the previous unsized tests, which used slices, and have been removed. While we're here, expand `test_as_bytes_methods` to test the `write_to`, `write_to_prefix`, and `write_to_suffix` methods, which were not previously tested. Also in order to test this support, implement zerocopy traits for `PhantomData` and `ManuallyDrop` for unsized types. While we're here, add a new `test_impls` test to ensure that all expected zerocopy trait impls are emitted.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
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.
In order to test this support, add a new
Unsized
type in zerocopy'stest
module. Use this to test the derive and also to testAsBytes
'smethods in
test_as_bytes_methods
. These tests supersede the previousunsized tests, which used slices, and have been removed.
While we're here, expand
test_as_bytes_methods
to test thewrite_to
,write_to_prefix
, andwrite_to_suffix
methods, which were notpreviously tested.