-
Notifications
You must be signed in to change notification settings - Fork 13.3k
incremental compilation + proc macros: undefined symbol error #47292
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
Comments
Thanks for the bug report, @rukai! |
Let's see if #47181 fixes this... |
@michaelwoerister #47181 did not fix this. I am still seeing the same thing on rustc 1.25.0-nightly (e6072a7 2018-01-13) which contains that PR. |
Thanks a lot for verifying. Nominating for priority assignment (I'd say P-High). |
A couple of questions for people knowing about proc-macros (@dtolnay, @jseyfried, @alexcrichton, maybe?):
|
@michaelwoerister there should only be one per crate which is generated by the compiler, so we should have complete control over it. |
Syntactically it's manufactured here |
Ok, so |
I know what's going on here now: The registrar function is generated in its own module, which means that it is not recompiled during incremental compilation unless its contents change. The symbol for the registrar contains the raw I think the best solution is to just remove the |
@michaelwoerister ah sounds like that'd do it! Unfortunately I don't know enough about regular plugins to know whether this is enough for them. |
Working on a PR right now. |
Removed nomination since there's already a fix in the queue. |
…omatsakis Don't include DefIndex in proc-macro registrar function symbol. There can only ever be one registrar function per plugin or proc-macro crate, so adding the `DefIndex` to the function's symbol name does not serve a real purpose. Remove the `DefIndex` from the symbol name makes it stable across incremental compilation sessions. This should fix issue #47292.
This seems to be fixed now that you've merged #47494 , as I don't encounter it anymore. |
Confirmed fixed. Thanks! |
Disabling incremental compilation or deleting the build files fixes the issue.
Steps to reproduce
In case the changes to source code above weren't clear, refer to the commits 1 & 2 https://github.com/rukai/syn/commits/bug
The text was updated successfully, but these errors were encountered: