Update to syn 2.0#56
Open
mre wants to merge 1 commit into
Open
Conversation
Update parse_terminated to include separator token parameter as required by syn 2.0 API changes. Replace Attribute field access with method calls: - path -> path() - tokens -> meta Update attribute parsing to handle new Meta structure and provide better error messages based on attribute type (Path, List, NameValue). These changes were needed to fix compilation errors after dependency update to syn 2.0.101.
Owner
|
Thanks for the PR, I will take a closer look when I get some time. |
Owner
|
Using Rust 1.87.0, I see some mismatches in the expected compiler output. You can update |
AzureMarker
reviewed
May 18, 2025
| } else { | ||
| Err(Error::new( | ||
| attr.span(), | ||
| format!("Unknown attribute: 'shaku{}'", attr.tokens), |
Owner
There was a problem hiding this comment.
I think you could replace the format call with "Unknown attribute" to keep this simple. The span should indicate to the user where the error is.
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.
Summary
It would be great if we could update syn to version 2.0 of the API as using syn 1.0 causes some downstream projects to have multiple versions of syn in the dependency tree at the moment. There have been some breaking API changes in syn 2.0, but nothing out of the ordinary. The only think I'm not 100% sure about is the error message for unknown shaku attributes; I can change that if needed.
Details
Update
parse_terminatedto include separator token parameter as required by syn 2.0 API changes. Replace Attribute field access with method calls:Update attribute parsing to handle new Meta structure and provide better error messages based on attribute type (Path, List, NameValue).
These changes were needed to fix compilation errors after dependency update to syn 2.0.101.
Note that the compiler output changed; I updated it accordingly with
TRYBUILD=overwrite cargo test -p shaku --test shaku_ui.