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 to Rust 2018, syn/quote/proc-macro2 1.0 #177

Merged
merged 7 commits into from
Sep 25, 2019

Conversation

tjkirch
Copy link
Collaborator

@tjkirch tjkirch commented Sep 24, 2019

Decision made in #154.
Fixes #164.

This takes advantage of all of the improvements in syn/quote/proc-macro2 1.0 that I could find in the code, and switches to some Rust 2018 idioms, but more could probably be done with more familiarity or research.

Certainly some of the changes in my commits are debatable, for example removing vs. replacing the rust_1_30 feature. We don't have anything conditional on version after this, so I opted for the simpler result of removing it.

Unit and compatibility tests pass.

@tjkirch
Copy link
Collaborator Author

tjkirch commented Sep 24, 2019

Trying to figure out why the 1.31 test passes locally but fails in CI...

Copy link
Owner

@shepmaster shepmaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, as usual. Just a few minor nits

Cargo.toml Outdated Show resolved Hide resolved
compatibility-tests/v1_31/Cargo.toml Outdated Show resolved Hide resolved
@shepmaster shepmaster added maintenance Keeping the wheels turning breaking change Likely requires a SemVer version bump labels Sep 24, 2019
The new minimum supported Rust version will be 1.31.  This removes the
rust_1_30 feature, which was used to opt into better support for
higher-than-minimum versions of Rust; it's no longer needed because there we
have no features that require beyond Rust 1.31.  Code that was conditional on
rust_1_30 is now required.

Compatibility tests for 1.30 were replaced with 1.31.

Background: shepmaster#154
Now that Rust 1.31 is the minimum version, we can update to the Rust 2018
edition and use some of its simpler idioms.

This doesn't change every single location that could be simplified with Rust
2018 syntax, but does clean up via `cargo fix --edition` and remove some of the
more obnoxious extra reference operators that are now implied.
The only mandatory change is the two places we're accessing the field named
"tts" on syn::Attribute, which changed to "tokens".  The other changes are us
following suit, changing fields and variables named "tts" to "tokens".
Copy link
Owner

@shepmaster shepmaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this thing!

❤️

@shepmaster shepmaster merged commit f5dd044 into shepmaster:master Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Likely requires a SemVer version bump maintenance Keeping the wheels turning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade syn/quote/proc-macro2 to 1.0
2 participants