Skip to content

Commit

Permalink
Enable extra-traits feature on syn dependency
Browse files Browse the repository at this point in the history
As it turns out a Debug implementation for the syn::NestedMeta type is
only available if the 'extra-traits' feature of the crate is enabled.
That is implicitly the case for edition 2018 projects, where resolver v1
is used, which unifies features between regular and dev-dependencies.
However, if the crate is used from an edition 2021 project, resolver v2
is active and it will compile syn with only the explicitly specified
features -- which do not include 'extra-traits'. This may cause a build
failure.
This change fixes the problem by explicitly enabling the 'extra-traits'
feature. Unfortunately, we do not yet want to switch to using edition
2021 or resolver v2 for this crate ourselves -- which would allow us to
detect problems like this in CI moving forward -- as that involves yet
another (arguably significant) minimum supported Rust version bump. So
for now this fix is all we have.
  • Loading branch information
d-e-s-o committed Mar 24, 2022
1 parent fb384b2 commit 4ba9344
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Unreleased
----------
- Fixed potential build failure when used from edition 2021 crates


0.2.9
-----
- Added support for inner `#[test]` attribute arguments
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ log = []
[dependencies]
proc-macro2 = "1.0"
quote = {version = "1.0"}
syn = {version = "1.0", features = ["full"]}
syn = {version = "1.0", features = ["extra-traits", "full"]}

[dev-dependencies]
env_logger = {version = "0.9", default-features = false}
Expand Down

0 comments on commit 4ba9344

Please sign in to comment.