-
Notifications
You must be signed in to change notification settings - Fork 13.3k
using pub macro_rules outside of the crate ICEs with Missing span for DefIndex(3)
#83641
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
Missing span for DefIndex(3)
Missing span for DefIndex(3)
Note that I was not able to reproduce this without using a main.rs or test file, which is why i think it's about being used outside of the crate. |
It appears to be because it's trying to give me a helpful error for the variable i never defined that i'm passing as an argument to the macro |
Unfortunately, the feature was merged in half-implemented state. |
@petrochenkov yeah, I understood that and I was going to work on this problem. At some point these changes that were supposed to be included in edition 2021, are now (if I'm not wrong) not going to be included so I ended de-priorizing this work. Please @nikomatsakis correct me if I'm wrong. We may want or to have this open and assigned to me or @petrochenkov you can feel free to fix this too or we can also revert the included PR too. |
I think at this point we should just revert the PR. My sense was that we never quite got the design resolved to the point where we were confident we were going to go forward with it. Another option would be to add the "half-baked" flag that gives warnings when you use it, of course. |
I think the 'half-baked' flag is still worth having, but it would be helpful if it noted that out of crate use is unlikely to work. |
My personal take is that if nobody is actively pursuing this design (and I think nobody is) we should just revert the PR. |
Have opened a PR #83713 to revert this. As I've commented there, I guess if someone has time to make it work cross crates we could add the feature again with cross crate support. |
Issue: rust-lang/rust#83641
…nikomatsakis Revert "Rollup merge of rust-lang#82296 - spastorino:pubrules, r=nikomatsakis" This reverts commit e2561c5, reversing changes made to 2982ba5. As discussed in rust-lang#83641 this feature is not complete and in particular doesn't work cross macros and given that this is not going to be included in edition 2021 nobody seems to be trying to fix the underlying problem. When can add this again I guess, whenever somebody has the time to make it work cross crates. r? `@nikomatsakis`
Triage: ICE has gone by #83713, I'm going to mark this as |
Hmm, I'm not sure if we need a regression test for this -- it's a regression test for a feature that no longer exists and may well never be added again -- but I guess it doesn't hurt. |
Ah, good call, I'm not familiar with the context. @nikomatsakis feel free to just close if you like :) |
Yes, this can be closed now. |
using pub_macro_rules on the latest nightly, i get this compiler panic.
index varies according to the code that's running as you might expect
Code
in a project called 'repro'
main.rs:
lib.rs:
Meta
Error output
The text was updated successfully, but these errors were encountered: