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

Add a quote_spanned! macro #55

Merged
merged 1 commit into from
Nov 21, 2017
Merged

Conversation

alexcrichton
Copy link
Collaborator

This commit adds a new quote_spanned! macro which works the same as quote!
except that it takes a span as an argument to attach to all tokens that are
generated as part of the quoting process.

This commit adds a new `quote_spanned!` macro which works the same as `quote!`
except that it takes a span as an argument to attach to all tokens that are
generated as part of the quoting process.
@alexcrichton
Copy link
Collaborator Author

cc rust-lang/rust#45934 which has a lot of discussion, but the tl;dr; is that Span::def_site() (the previous default) isn't always wanted, so sometimes we want to quote! where tokens are all gaining Span::call_site() spans.

Copy link
Collaborator

@mystor mystor left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@dtolnay dtolnay merged commit 07deeb5 into dtolnay:master Nov 21, 2017
@alexcrichton alexcrichton deleted the quote-spanned branch November 21, 2017 18:40
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.

3 participants