Allow crate to compile without leaking features from dev-dependencies.#5
Merged
althonos merged 1 commit intoalthonos:masterfrom Jun 4, 2021
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5 +/- ##
=======================================
Coverage 78.18% 78.18%
=======================================
Files 9 9
Lines 495 495
=======================================
Hits 387 387
Misses 108 108 Continue to review full report at Codecov.
|
Contributor
Author
|
ps I didn't run rustfmt, as that wanted to reformat the entire crate more or less. |
4f5fa05 to
d4f0a66
Compare
Contributor
Author
|
Ah, the merge conflicts caused a bug here. I'll try and fix. |
d4f0a66 to
8df425f
Compare
When adding blanket as a dependency to a blank cargo project, it fails to compile. This is due to missing features on the syn crate. This commit adds the needed features. This problem could not be detected from within the crate itself because features were leaking through from the dev-dependency of syn which does not have `default-features = false`. I turned on `resolver = "2"`. This is the new feature resolver for cargo that will become the default in edition 2021. This is not strictly necessary but it helps as it no longer leaks features. This means that `cargo check` will now fail if there are missing features. As `cargo test` obviously turns on the features from `dev-dependencies`, this will still not detect this issue. You might want to check your CI script and add a `cargo check` before running `cargo test`.
8df425f to
ba4ab9a
Compare
Owner
|
Good catch, thanks! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
When adding blanket as a dependency to a blank cargo project, it fails to
compile. This is due to missing features on the syn crate.
This commit adds the needed features. This problem could not be detected
from within the crate itself because features were leaking through from
the dev-dependency of syn which does not have
default-features = false.I turned on
resolver = "2". This is the new feature resolver for cargothat will become the default in edition 2021. This is not strictly necessary
but it helps as it no longer leaks features. This means that
cargo checkwill now fail if there are missing features. As
cargo testobviously turnson the features from
dev-dependencies, this will still not detect theissue.
You might want to check your CI script and add a
cargo checkbeforerunning
cargo test.NOTE: rebased on #3 and #4, so you probably want to merge them first.