-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make zerocopy-derive an optional dependency (#176)
This requires a few changes to accomodate: - We still want to be able to derive zerocopy traits on our own types so that we can rely on it to validate the soundness of those impls for us. That means that, when the `derive` feature is enabled, we still use custom derives, but when it's disabled, we implement traits manually. However, we also need to ensure that our manual trait impls have the correct bounds required in order for those impls to be sound. In order to ensure this, we introduce an `impl_or_verify!` macro which, when building with `derive` enabled, verifies that the manual impl matches the one emitted by our custom derive. - Since some doc examples use custom derives, we can no longer run doc tests unconditionally in CI - when the `derive` feature is disabled, doc tests fail. Instead, we disable doc tests by default (in order to run them, `cargo test` must be run with the `--doc` flag). We introduce a separate "Run doc tests" step in CI - this step only runs when the `derive` feature is enabled. Closes #169
- Loading branch information
Showing
13 changed files
with
556 additions
and
114 deletions.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.