refactor(macros): bump syn to v3 - #679
Open
AudaciousAxiom wants to merge 2 commits into
Open
Conversation
AudaciousAxiom
commented
Aug 5, 2026
| }; | ||
|
|
||
| if f.sig.unsafety.is_none() { | ||
| if !matches!(f.sig.safety, syn::Safety::Unsafe(_)) { |
Author
There was a problem hiding this comment.
Function "safety" is now encoded with a 3-variant enum.
| }; | ||
|
|
||
| if f.sig.unsafety.is_none() { | ||
| if !matches!(f.sig.safety, syn::Safety::Unsafe(_)) { |
Author
There was a problem hiding this comment.
Function "safety" is now encoded with a 3-variant enum.
| proc-macro2 = "1.0.106" | ||
| quote = "1.0.45" | ||
| syn = { version = "2.0.117", features = ["extra-traits", "full"] } | ||
| syn = { version = ">= 2.0.117, < 4", features = ["extra-traits", "full"] } |
Author
There was a problem hiding this comment.
cortex-m-macros seems to work with either syn v2 or v3: this allows both but, because cortex-m-rt-macros does depend on the v3 specifically, and as most dependents use both, you may prefer to depend on the v3 to simplify this a bit:
Suggested change
| syn = { version = ">= 2.0.117, < 4", features = ["extra-traits", "full"] } | |
| syn = { version = "3.0", features = ["extra-traits", "full"] } |
Allowing both versions allows dependents that only depend on cortex-m-macros and don't otherwise have a (transitive) dependency on syn v3 to only use syn v2, thus avoiding the dependency duplication.
AudaciousAxiom
marked this pull request as ready for review
August 5, 2026 08:10
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.
Following the release of a new major version of
syn, this bumps the version used bycortex-m-macrosandcortex-m-rt-macros, with the goal of eventually removing the duplicated dependency in binaries (and therefore reducing compile times).synv3 advertises an MSRV of 1.71, so this shouldn't affect the MSRV of these crates given the recent bump to 1.85.I've gone through the changelog and did the necessary refactor; I didn't find any other relevant breaking changes (but there are quite a few of them so I could have missed some). I've run
cargo testbut didn't do any other kind of testing.