-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
use
suggestions corrupted w/ nearby code when inside items
#43769
Comments
Duplicate of #42835 |
Is it a duplicate? Issue here is the suggestion text is invalid. |
I don't think this is a duplicate of that issue; the diagnostic here needs to be enhanced to not be mangled with surrounding context, which isn't related to updating the message to note where to add the import. cc @estebank, I seem to recall you doing something with this diagnostic recently that was potentially relevant, but I could be wrong. |
It is 100% related. I changed the suggestion placement and screwed up. The suggestions are placed at the beginning of the current module/function, but that just doesn't work in the presence of desugarings. So the suggestion you see doesn't mangle with surrounding context, it is actually placed there! |
Anyway, the original issue that's more related is #42548, but they are all caused by the same underlying problem |
@Mark-Simulacrum I think the closest PRs I've worked on recently have been #42383 and #42904, but I doubt they affected the current issue given that I'm seeing the problem in the stable compiler as well. #42835 might be related (which sparked my urgency on completing #42904, so that it'd be more obvious when it happens). |
This is... bizarre.
STR
Expected
Actual
The issue seems to arise from the erroneous code being inside another block. I originally encountered this with code generated by `lazy_static!`.
The text was updated successfully, but these errors were encountered: