rustc: Tweak expansion of #[proc_macro] for 2018#52326
Conversation
|
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
a06f8a7 to
a67ba36
Compare
|
r? @nrc cc @petrochenkov (not directly related to macros 1.2, but you probably want to be aware of this) |
There was a problem hiding this comment.
Can't we always generate crate::proc_macro_fn regardless of editions and enabled features?
The whole registrar code is under allow_internal_unstable: true span anyway.
There was a problem hiding this comment.
I thought so! I originally did that but it generated feature errors :(
There was a problem hiding this comment.
That's because the path spans are set to cd.span/ca.span/cm.span and not span.
You can use cd.span.with_ctxt(span.ctxt()) to keep the sane locations, but apply stability hygiene.
There was a problem hiding this comment.
Worked like a charm!
The syntactical expansion of `#[proc_macro]` and related attributes currently contains absolute paths which conflicts with a lint for the 2018 edition, causing issues like rust-lang#52214. This commit puts a band-aid on the issue by ensuring that procedural macros can also migrate to the 2018 edition for now by tweaking the expansion based on what features are activated. A more long-term solution would probably tweak the edition hygiene of spans, but this should do the trick for now. Closes rust-lang#52214
a67ba36 to
94c9ea4
Compare
|
@bors r+ |
|
📌 Commit 94c9ea4 has been approved by |
|
⌛ Testing commit 94c9ea4 with merge 6241dcf5557f9f4d7481205581d4500d11e29230... |
|
💔 Test failed - status-appveyor |
…henkov rustc: Tweak expansion of #[proc_macro] for 2018 The syntactical expansion of `#[proc_macro]` and related attributes currently contains absolute paths which conflicts with a lint for the 2018 edition, causing issues like #52214. This commit puts a band-aid on the issue by ensuring that procedural macros can also migrate to the 2018 edition for now by tweaking the expansion based on what features are activated. A more long-term solution would probably tweak the edition hygiene of spans, but this should do the trick for now. Closes #52214
|
💔 Test failed - status-travis |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
1 similar comment
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
@bors retry |
|
⌛ Testing commit 94c9ea4 with merge 253a01c41e1a51b368699199a158bb9eb4dd70c6... |
|
💔 Test failed - status-travis |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
1 similar comment
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
…henkov rustc: Tweak expansion of #[proc_macro] for 2018 The syntactical expansion of `#[proc_macro]` and related attributes currently contains absolute paths which conflicts with a lint for the 2018 edition, causing issues like #52214. This commit puts a band-aid on the issue by ensuring that procedural macros can also migrate to the 2018 edition for now by tweaking the expansion based on what features are activated. A more long-term solution would probably tweak the edition hygiene of spans, but this should do the trick for now. Closes #52214
|
☀️ Test successful - status-appveyor, status-travis |
The syntactical expansion of
#[proc_macro]and related attributes currentlycontains absolute paths which conflicts with a lint for the 2018 edition,
causing issues like #52214. This commit puts a band-aid on the issue by ensuring
that procedural macros can also migrate to the 2018 edition for now by tweaking
the expansion based on what features are activated. A more long-term solution
would probably tweak the edition hygiene of spans, but this should do the trick
for now.
Closes #52214