-
Notifications
You must be signed in to change notification settings - Fork 152
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
Use proc_macro2::Span::call_site
for all quotes
#77
Use proc_macro2::Span::call_site
for all quotes
#77
Conversation
3c80b6c
to
733ff4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update CHANGELOG.md with your change.
Looks like a dirty workaround, I have to read some doc to understand the problem properly.
@@ -0,0 +1,3 @@ | |||
macro_rules! my_quote { | |||
($($t:tt)*) => (quote_spanned!(::proc_macro2::Span::call_site() => $($t)*)) | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you had a file, you should add the header. But maybe for that, just defining it in lib.rs is OK.
Travis should also be updated to test with the problematic feature, no? |
733ff4f
to
a3409f2
Compare
This avoids breakage when deriving `StructOpt` when `proc_macro2`'s nightly feature is enabled. See dtolnay/proc-macro2#67 for details.
a3409f2
to
a028c45
Compare
Added
|
FWIW This isn't so much a workaround as necessary today based on today's hygiene implementation, otherwise fixing this without changing span information would require far more intrusive changes to structopt which'd probably want to be delated for later :) |
OK. I tried to look at it, but didn't really understand why it doesn't find std. If you know of any doc on that or any similar problem fixed in another project, I would be interested to look at it for my own curiosity. |
v0.2.5 published |
@TeXitoi rust-lang/rust#45934 may have a bit more of a writeup if you're interested to dig more! |
Thanks |
This avoids breakage when deriving
StructOpt
whenproc_macro2
's nightly feature is enabled. See dtolnay/proc-macro2#67 for details.cc @alexcrichton