-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 full name to identify a macro in a FileName
.
#54338
Conversation
Before this two macros with same name would be indistinguishable inside a `FileName`. This caused a bug in incremental compilation (see rust-lang#53097) since two different macros would map out to the same `StableFilemapId`. Fixes rust-lang#53097.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nrc (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Ping from triage @nrc, this PR requires your review. |
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.
Code looks good, could you write a regression test for this?
The problem is that this is non-deterministic (probably the source of non-determinism is an hashtable somewhere, since they have a random seed). However I may be able to write a test that has a very high chance of failing. |
@nrc I tried a few things but I was unable to create a test that reproduced the bug. In fact the only way that I can reproduce it is by doing what I describe in #53097 (comment) (any change of the example I do would not trigger the bug). |
@bors: r+ |
📌 Commit 2d7edf9 has been approved by |
☀️ Test successful - status-appveyor, status-travis |
re-adding beta-nominated so that this will (hopefully) be enqueued for backport |
[beta] Rollup backports Merged and approved: * #54650: Don't lint non-extern-prelude extern crate's in Rust 2018. * #54338: Use full name to identify a macro in a `FileName`. * #54518: resolve: Do not block derive helper resolutions on single import resolutions * #54581: Accept trailing comma in `cfg_attr` r? @ghost
[beta] Rollup backports Merged and approved: * #54650: Don't lint non-extern-prelude extern crate's in Rust 2018. * #54338: Use full name to identify a macro in a `FileName`. * #54518: resolve: Do not block derive helper resolutions on single import resolutions * #54581: Accept trailing comma in `cfg_attr` r? @ghost
Before this two macros with same name would be indistinguishable inside a
FileName
. This caused a bug in incremental compilation (see #53097) since two different macros would map out to the sameStableFilemapId
.Fixes #53097.
r? @nrc