-
Notifications
You must be signed in to change notification settings - Fork 1.7k
crash: goblin crate #3309
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
Looking into this. It's turning out to be a deep rabbit hole. I'll continue to test. |
I've found that this crash has probably always existed. It is reproducible with the rustc and clippy version shipped with rustup stable. Still trying to determine the root cause. |
It looks like the crash is occurring because clippy is trying to create a suggestion with 2 span replacements, but because the lint triggers within a proc macro, the compiler tries to apply the replacement to the same span, and crashes. What is the typical way of handling these scenarios? Is there a mechanism within clippy to ignore lints within macro expansions? If we removed the suggestion, it would resolve the crash, but we wouldn't want to remove the suggestion in cases where it can be applied properly. |
@shssoichiro For ignoring macro expansions, you can use the in_macro() function. It depends on the specific case whether we want to remove the suggestion or not. I would say fixing the crash is more important than suggestion correctness. We can always file a separate issue to work on the suggestion in a second step. Did you find a small code snippet that reproduces the crash? |
Yes, I do have a minified test case which I'll include in the PR. |
Uh oh!
There was an error while loading. Please reload this page.
clippy @ 78860a7
Found via #3142
The text was updated successfully, but these errors were encountered: