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
false positives when detecting errors in editor #9432
Comments
Yep, this is occurring for me as well. Seems like the new Rust plugin update borked much of the Rust plugin's ability to distinguish between genuine errors and false positives. |
[+1] |
Just to ask a question: Isn't this the case to rollback this version? Right now it's in a pretty unusable state. |
The question is, revert the plugin, IntelliJ, or both? |
I also noticed that in some conditions, after replacing strings in a selection, the selection would disappear (no text is selected after the replacement), making it tedious to do successive replacements. But I couldn't reproduce it. It does feel quite unstable. I reverted to 178. For now I don't see those type problems anymore but there are still strange bugs when I copy / paste code, sometimes it escapes it when there is no reason to do so. I was copying Maybe it's the usual IntelliJ instability. I have funny things regularly happening in Kotlin too, sometimes I have to reinstall everything after a thorough clean-up. |
So far I haven't seen the problem since I reverted to Rust 0.4.178.4873-222, so I would say it's a good work around. I think those type-related optimizations above may have broken something in the trait system in version 0.4.179. It seems unable to see what traits are supported by a type. Procedure:
No need to uninstall it first. Maybe a |
@blueglyph, @helios2k6, @bruno-ortiz, could you please attach your IDE logs? You can collect them using |
Hmm, I can't set the permissions so they are public. I'll make a bug report on Jetbrain's Youtrack instead. |
@blueglyph you can do it via https://uploads.jetbrains.com not to make them publicly available |
Here's the reference: You can look at September 30th, the problem came back a few times. If that's easy for you to find, it happened before I did the first restart & invalidate, so I see one at 15h27. It came back several times later too, and it was pretty much permanent until the end of the day. If it's too hard to spot I can clean the logs and try again but I'll have to update the plugin first. Or if I have to do something specific to help (custom properties, ...), just let me know. |
@vlad20012 here's the upload id: |
@vlad20012: Upload id: 2022_10_02_YciksdcsAnSa12EKtW9Uhq (file: stdout_logs.log). Just FYI, I'm on Linux and using the Help > Collect Logs and Diagnostic Data menu item does nothing so I copied the logs from stdout. |
Any chance you work on some open source project? In this case, could you please link the project and mention the file you experience such false-positives? If project is not open-source, but it's not under NDA, may I ask you to upload it using https://uploads.jetbrains.com/ ? |
@vlad20012
I hope the root cause is common with what we saw. I didn't find anything more obvious, because the problems are hard to reproduce just by working in the IDE. If I re-install the new version, I don't see the errors immediately, I need to work on the project for a little while. So that's not something I can just hand you because it wouldn't be efficient. But I'd say you have a good chance to see the problem in any of your own projects if you're working a few hours with the new plugin version. |
I managed to reproduce it! Thank you! |
Thanks for looking into this! :) |
Amazing! Good to hear! |
Actually, the bug is a wrong (missing) implementation of CargoBasedCrate.equals/hashCode
It was difficult, but I solved this riddle! Technical explanation: |
Remarkable! Great work! |
Well done, thanks for the quick resolution of this annoying issue! |
Actually, the bug is a wrong (missing) implementation of CargoBasedCrate.equals/hashCode (cherry picked from commit f640f7b)
The issue is fixed in the nightly plugin. You can try it now (see instructions) Thank everyone for participating! |
I'm encountering something similar, I think, though I'm unsure if it's related to the issue. pub struct ControllerAuth<const CHECK_LOGIN: bool = true> {
/// The id of the controller
pub id: u32,
}
Edit: Noticed that the issue is also present when used in the generic parameter for an impl block: impl<const CHECK_LOGIN: bool> FromRequest for ControllerAuth<CHECK_LOGIN> { |
@TobiasDeBruijn Hi! It seems like something went wrong with macro expansion in your case, could you please try to perform |
That indeed fixes it. Interestingly though, neither the struct nor the impl block have macros on them. |
@TobiasDeBruijn, |
Ah in that way. Alright, thanks! |
…vity Actually, the bug is a wrong (missing) implementation of CargoBasedCrate.equals/hashCode
Environment
Problem description
I get a lot of underwaved errors when editing Rust code, for
println!
and similar macros, with the following explanation: "'(type)' doesn't implement 'Display', for types like String, usize, ...The program compiles without any error or warning, and runs without any problem.
A few examples:
'usize' doesn't implement 'Display':
'String' doesn't implement 'Display': (the tooltip only shows the function signature, not the error)
here, a function that takes any type from which f64 can be taken:
(function signature)
This makes IntelliJ's error detection unusable and is very annoying.
Misc info
Some of the errors disappear if I invalidate the cache and restart the IDE (File, Invalidate Caches...), but not all of them. Then they come back after a while.
I never saw that in 2022.2.1. I think I briefly used it with 1.64 and never saw those problems either. I have just updated to 2022.2.2 and now I'm seeing them all the time.
EDIT: work-around by reverting to previous version, see post below.
The text was updated successfully, but these errors were encountered: