-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
macro_use_imports
ICE: can't get the span of an arbitrary parsed attribute: ...
#14303
Comments
This is rust-lang/rust#137640. Maybe we should keep this issue open here on this repo for visibility to help with the duplicates. |
I also pinned this issue now. We had a free slot anyway. Maybe that prevents people from opening more issues about this. |
It is not possible to write a declarative macro, that produces an attribute w/o an item attached to it. This means that the `check_item` will already insert the span in the map, if it came from an expansion. So additionally checking if the macro came from an expansion doesn't add anything here. So the `check_attribute` function, and with that the problematic `attr.span()` call can be completely removed. Fixes rust-lang#14303
It is not possible to write a declarative macro, that produces an attribute w/o an item attached to it. This means that the `check_item` will already insert the span in the map, if it came from an expansion. So additionally checking if the macro came from an expansion doesn't add anything here. So the `check_attribute` function, and with that the problematic `attr.span()` call can be completely removed. Fixes rust-lang#14303
It is not possible to write a declarative macro, that produces an attribute w/o an item attached to it. This means that the `check_item` will already insert the span in the map, if it came from an expansion. So additionally checking if the macro came from an expansion doesn't add anything here. So the `check_attribute` function, and with that the problematic `attr.span()` call can be completely removed. Fixes #14303 r? @y21 cc @jdonszelmann changelog: Fix ICE in [`macro_use_import`] lint
Update: The issue was fixed in Clippy. Now this has to be synced to the Rust repo in order to get into nightly. This is done in rust-lang/rust#137752. However, that is delayed due to CI issues in the Rust repo. It should land in |
Update: the fix made it into the rust repo and will be in |
Looks like the fix indeed is in today's nightly 🎉 |
Summary
Found in CI here
Playground
Version
Error output
Backtrace
The text was updated successfully, but these errors were encountered: