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

Remove quote dependency #3

Merged
merged 3 commits into from
Apr 8, 2024
Merged

Remove quote dependency #3

merged 3 commits into from
Apr 8, 2024

Conversation

BD103
Copy link
Contributor

@BD103 BD103 commented Mar 30, 2024

quote's only usage is returning a unit () statement. This behavior can be accomplished by calling TokenStream::new, which returns an empty token stream.

This does change the generated output, but it still accomplishes the same result.

// stretch_your_legs.rs

// Before
fn main() {
    ();
}

// After
fn main() {

}

Unfortunately it only removes quote as an immediate dependency. syn still dependends on quote, even when I reduced the enabled features. I'm pretty sure this is a bug (on this line), but there is nothing that can be done in this PR.

@BD103
Copy link
Contributor Author

BD103 commented Mar 30, 2024

I just created dtolnay/syn#1608 and it was merged, so quote should fully be removed as a dependency next time syn releases. All that needs to be done is to cargo update and specify a minimum syn version to 2.0.56.

`quote` is still in the lockfile, but it is no longer being built by cargo.
@BD103
Copy link
Contributor Author

BD103 commented Mar 30, 2024

Ok, that's about as much as I can do. quote is still being included in the lockfile for reasons I don't understand, but it is no longer being built by cargo so it's good enough.

@taiki-e
Copy link

taiki-e commented Mar 30, 2024

quote is still being included in the lockfile for reasons I don't understand

I think this is due to rust-lang/cargo#10801.

Copy link
Owner

@radekvit radekvit left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution, this is a nice improvement.

I never thought I'd get PRs making this compile faster, but here we are.

@radekvit radekvit merged commit 5667176 into radekvit:main Apr 8, 2024
@BD103 BD103 deleted the rm-quote branch April 8, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants