Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update syn requirement from 1.0.81 to 2.0.6 #251

Merged
merged 10 commits into from
Jun 12, 2023
Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 22, 2023

Updates the requirements on syn to permit the latest version.

Commits
  • 7840102 Release 2.0.6
  • e76d644 Merge pull request #1420 from dtolnay/nonbracemacro
  • 6dcc480 Keep non-brace macro invocations in trailing expr position as Expr::Macro
  • d12db40 Merge pull request #1419 from dtolnay/expectedsemi
  • 69c5efc Improve error message on missing ';' between statements
  • fd18254 Release 2.0.5
  • 4df4c4e Merge pull request #1417 from dtolnay/exprmacro
  • f591c40 Provide Expr::Macro even with features="full" off
  • fb1062f Eliminate allow_struct args in non-full mode
  • 99de683 Factor out Path::is_mod_style private method
  • Additional commits viewable in compare view

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Fixes #249 > Note

Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

Updates the requirements on [syn](https://github.com/dtolnay/syn) to permit the latest version.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](dtolnay/syn@1.0.81...2.0.6)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Mar 22, 2023
@tyranron tyranron self-assigned this Mar 23, 2023
@tyranron tyranron added this to the 1.0.0 milestone Mar 23, 2023
@tyranron tyranron linked an issue Mar 23, 2023 that may be closed by this pull request
@tyranron tyranron marked this pull request as draft March 23, 2023 16:33
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Mar 23, 2023

A newer version of syn exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

@tyranron
Copy link
Collaborator

tyranron commented Mar 24, 2023

@JelteF @ilslv well, the problem of failing tests is dtolnay/syn#1414. syn::Path doesn't parse keywords as syn::Ident anymore, so we have a problem with parsing ref in our attributes. There are two ways of resolving this:

  1. Replace ref with r#ref and leave the current parsing code "as is" (like serde_with does).
  2. Preserve using ref, but rewrite attribute parsing to our own types.

I'd vote for the option 2, despite it requires more work. This also interferes with #248.

@ilslv
Copy link
Contributor

ilslv commented Mar 24, 2023

@tyranron I definitely vote for option 2 too.

@JelteF
Copy link
Owner

JelteF commented Apr 3, 2023

I think r#ref looks extremly ugly. I'm hoping the syn maintainer will fix this regression: dtolnay/syn#1414

But in case they don't I think I'd prefer changing the name over impleminting our own parsing, i.e. changing the name tho reference or something not to r#ref

@JelteF
Copy link
Owner

JelteF commented Apr 3, 2023

Okay so after looking into it more, it seems that custom parsing would be fine too. As long as we only skip parsing the full list as as a meta list again. We can still use syn to parse the elements of the list though.

@JelteF
Copy link
Owner

JelteF commented Apr 3, 2023

Still maybe changing ref to reference is the nicer option. I definitely wouldn't have gone with ref over reference when creating this feature originally if it required writing custom parsing code. Now that it becomes a breaking change, it becomes a different question though. But I'd say it's a small enough breaking change, with an easy way of addressing it, that it shouldn't hurt too badly for the few users of this feature.

@tyranron
Copy link
Collaborator

tyranron commented Apr 4, 2023

@JelteF reference is too long, ref is just much more ergonomic.

Regarding custom parsing - I don't see this as a minus. Outside derive_more I do use custom parsing most of the time (even before syn 2.0), because it's much easier to read such code and understand, as the parsed stuff explicitly defined in meaningful types. The same why we prefer derive(Deserialize) on a struct rather than tinkering around serde_json::Value.

I will try to finish this PR in next few days.

@JelteF
Copy link
Owner

JelteF commented Apr 8, 2023

Alrigth sounds good, let's go with the custom parsing for ref then.

@JelteF
Copy link
Owner

JelteF commented May 8, 2023

@tyranron friendly ping :). I feel like we're super close to releasing 1.0

@tyranron
Copy link
Collaborator

@JelteF I'm super sorry, have been so overwhelmed on my job last weeks that couldn't even touch it. Now it seems I start getting some time for open source again, and getting derive_more released is my primary focus.

I've implemented minimal polyfill for parsing ref, it works now. However, some new problems arose from fmt macros. Will fix them tomorrow.

@tyranron tyranron marked this pull request as ready for review May 12, 2023 17:50
@tyranron tyranron requested a review from JelteF May 12, 2023 17:51
@tyranron
Copy link
Collaborator

@JelteF ping 🙃

@tyranron
Copy link
Collaborator

@JelteF ping

@JelteF JelteF merged commit 1fb07f1 into master Jun 12, 2023
@JelteF JelteF deleted the dependabot/cargo/syn-2.0.6 branch June 12, 2023 16:47
@JelteF JelteF mentioned this pull request Jun 12, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to syn 2.0
3 participants