-
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
Improve proc-macro def ids #38278
Improve proc-macro def ids #38278
Conversation
I manually verified via logs that |
cc @nrc |
@jseyfried I can take a stab at making a regr test involving incremental compilation |
@jseyfried This seems pretty clean though -- confined to metadata, as you promised. :) |
Well, I failed to produce a regr test and am now on vacation for a week. =) I'm inclined to r+ -- though I suspect that creating an incremental test that uses a proc macro would suffice. |
Unfortunately I also failed in producing a small test case. Why is it that these DefIds need special handling? |
@michaelwoerister normally we create an That said, I find this mildly confusing too. That is, in my mind's eye, we could still encode the procedural macro crate's items, since the path to the procedural macro that the user should be using is basically the path to the item that is annotated with That is, the way I think of it, the procedural macro is conceptually executed by interpreting the MIR attached to the procedural macro crate -- or, put another way, we attach some executable data to the I guess this view is inaccurate? |
Sounds about right to me. I don't think that there can be dynamically created procedural macros (although the macro/plugin registrar function infrastructure would probably allow that). |
@bors r+ I think we should refactor how DefPaths are handled in metadata but I don't want to block this PR on that. |
📌 Commit 5200a11 has been approved by |
⌛ Testing commit 5200a11 with merge a274617... |
…lwoerister Improve proc-macro def ids Support `cstore.relative_def_path(id)` and `cstore.def_key(id)` with proc-macro def ids. Fixes #38207. r? @nikomatsakis
@nikomatsakis However, refactoring the current registrar-based system implemented in #35957 to either of these options will probably be quite a bit of work (it might be a good idea to combine this with a transition from dynamic linking to IPC -- cc @eddyb). |
@jseyfried The repro in #38237 hits the assert you added to |
Support
cstore.relative_def_path(id)
andcstore.def_key(id)
with proc-macro def ids.Fixes #38207.
r? @nikomatsakis