You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Macro resolution regression when a #[test] is named 'panic' #53675
Maybe it’s the use self::panic as panic; item that gets macro resolution confused? I’d expect that it only imports a function, not a macro, and they should be in separate namespaces.
@petrochenkov this seems kind of important to figure out, no? Have you had any further thoughts? If not, I'd be up to try and investigate a bit and see if I can figure something out.
visited for triage. Curious about an update from @petrochenkov about how to approach this and whether they have time to attack it. Assigning to self for further investigation/management.
Status update: still plan to investigate this (probably this week).
The delay is mostly due to prioritization - there were other regressions and urgent future-proofing work to complete before beta, but now all of that is done.
Activity
Work around Nightly bug
SimonSapin commentedon Aug 24, 2018
When removing the assert (to get past the error), the output of
--pretty=expandedis:Maybe it’s the
use self::panic as panic;item that gets macro resolution confused? I’d expect that it only imports a function, not a macro, and they should be in separate namespaces.petrochenkov commentedon Aug 24, 2018
Something is wrong with path resolution for macros in expression position specifically.
If you add a semicolon everything compiles.
SimonSapin commentedon Aug 24, 2018
FWIW in the non-reduced file https://github.com/servo/rust-mozjs/blob/dd338dae9bb68fa0cf23d4da21afc10e0153b27c/src/panic.rs the error is reported twice, one of them on a statement-macro with a semicolon:
petrochenkov commentedon Aug 24, 2018
IIRC, the second case is reported only because the first error (without semicolon) breaks everything.
This issue is kinda known, see
proc-macro-attributes.rsin 674a5db.pnkfelix commentedon Aug 30, 2018
visited for triage. After some discussion about severity, decided to tag as P-high.
nikomatsakis commentedon Sep 6, 2018
@petrochenkov what is required to fix this bug? Do we need to land something like #53913?
petrochenkov commentedon Sep 6, 2018
@nikomatsakis
I don't know, I didn't investigate what happens in this case, but #53913 is unlikely to be related.
nikomatsakis commentedon Sep 13, 2018
@petrochenkov this seems kind of important to figure out, no? Have you had any further thoughts? If not, I'd be up to try and investigate a bit and see if I can figure something out.
pnkfelix commentedon Sep 13, 2018
visited for triage. Curious about an update from @petrochenkov about how to approach this and whether they have time to attack it. Assigning to self for further investigation/management.
petrochenkov commentedon Sep 13, 2018
Status update: still plan to investigate this (probably this week).
The delay is mostly due to prioritization - there were other regressions and urgent future-proofing work to complete before beta, but now all of that is done.
petrochenkov commentedon Sep 13, 2018
Not sure how exactly, but this is already fixed.
#54209 adds tests.
Rollup merge of rust-lang#54209 - petrochenkov:mexpr, r=pnkfelix
Rollup merge of rust-lang#54225 - pnkfelix:issue-53675-add-test-calle…
Auto merge of #54319 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup merge of rust-lang#81387 - c410-f3r:tests-tests-tests, r=petro…
Rollup merge of rust-lang#81387 - c410-f3r:tests-tests-tests, r=petro…