-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support the associated proc macro pattern (#291)
The "associated proc macro pattern" is a trick for ensuring that `zerocopy` and `zerocopy-derive` have equal verions, even when the optional `derive` feature of `zerocopy` isn't used. The `derive` feature of `zerocopy` provides a convenient way for end-users to depend on `zerocopy-derive` that ensures that `zerocopy` and `zerocopy-derive` have exactly equal versions. Unfortunately, using this feature creates a dependency between these two crates that prevents them from being built in parallel. A compile-time-conscious user of `zerocopy` can avoid this by depending on both of these crates explicitly, but this places the onus on them to ensure that their versions are exactly equal. The "associated proc macro pattern" is a trick for ensuring that `zerocopy` and `zerocopy-derive` have equal verions, even when the optional `derive` feature of `zerocopy` isn't used. With it, an end-user of zerocopy can write: [dependencies] zerocopy = "MAJOR.MINOR" zerocopy-derive = "MAJOR.MINOR" ...and cargo will ensure that the actual versions that are used are exactly equal. For more information, see: https://github.com/matklad/macro-dep-test
- Loading branch information
Showing
5 changed files
with
111 additions
and
59 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