VS code with Rust Analyzer highlights errors twice, once with a squiggly line beneath the code and again with three dots. The error is also shown twice when hovering the mouse over the offending code (the three dots are hard to see as they are underneath the yellow squiggly line):
Disabling the VS Code "Problems: Visibility" option removes one instance of the error notification but you also lose all other error notifications across the workspace which is undesirable.
I'm guessing Rust Analyzer is also highlighting the code but I am not sure of the fix?
I believe all the errors are coming from rust analyzer and I'm guessing the duplication is some sort of quirk in vscode. It doesn't happen for all errors, just some of them. I searched the vscode github issues and did not find this mentioned , so you could file an issue there if you're motivated. (For me, the duplication is minor and I just tolerate it.)
Edit: I did find a rust analyzer issue but there is no comment from the maintainers saying this is a bug in rust analyzer itself, rather than a vscode bug. I suggest adding a comment or question to this issue.
I've tolerated it for a while, mostly because I find I get bombarded by so much information in vs code (symbols, icons of all different colours all over the place, underlines, pop ups etc) that I just ignore all of it. I thought if I try trimming some of it down I might be able to figure out what some of it means and what is actually useful.
I know what you mean. I've turned off the hover display and the lightbulb. I can still see that info on demand using key bindings. I'm much happier with those changes.
As someone still learning Rust (read the book, working through zero2prod) and really mostly a hobbyist when it comes to coding, it occurs to me that a really simple editor is probably the best way to learn a new language. That was certainly how I started learning coding with Python and Idle. It allows you just to work on writing code instead of getting hung up on every little error or linting issue. I don't really need to know my struct is unused when I'm still just defining it.
Obviously you outgrow that and want to start adding features in but preferably purposely, one at a time, so it is a conscious decision and you can understand how each one works and what its telling you.
Like what do those grey rectangles on the scrollbar mean that seem to pop up randomly? I'm sure they seemed like an excellent idea to someone but I have absolutely no clue...
There are also key bindings to learn if you want show this info on demand. In general, use Ctrl Shift P to list the commands and type the name of what you looking for; you can run it from there and also see the key binding for it.
You can disable these in the source code per module:
#![allow(unused)] // goes at top of module
Or per item:
#[allow(unused)] // goes above the item
And then remove or comment them when you're ready.