Every so often rust-analyzer in VS Code doesn’t use the latest code after a cargo update and the only way I’ve found to fix it is a cargo clean. This means that I have to wait 5 minutes for the next build, painful. Just because of one project update. I would LOVE a faster build.
Extra info: the updates come from my dependencies that utilize my private repositories via a git = "[path]". The rust-analyzer is pulling from a cache or older version for some reason and I don’t know where it is or why.
After cargo add I have to sometimes run the “restart rust-analyzer” command from the vscode command pallette (exact wording may be off, I’m on my phone as of writing this comment). Much faster than cargo build.
Consider using sccache to speed up rebuilds. It helps a lot, though uses a bit of disk space. But disk space is cheap nowadays (as long as you aren’t stuck with a laptop with soldered SSD, in which case you know what not to buy next time).
Every so often rust-analyzer in VS Code doesn’t use the latest code after a
cargo update
and the only way I’ve found to fix it is acargo clean
. This means that I have to wait 5 minutes for the next build, painful. Just because of one project update. I would LOVE a faster build.Extra info: the updates come from my dependencies that utilize my private repositories via a
git = "[path]"
. The rust-analyzer is pulling from a cache or older version for some reason and I don’t know where it is or why.Having 30min+ incremental compile times here (C++), I envy your situation ahah
Two tips that work for me: