this post was submitted on 26 Jan 2024
35 points (94.9% liked)

Rust

5974 readers
96 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

[email protected]

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 9 months ago (2 children)

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.

[–] [email protected] 5 points 9 months ago (1 children)

Two tips that work for me:

  • 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).
[–] [email protected] 1 points 9 months ago

Thanks for the suggestions. I appreciate it.

[–] [email protected] 1 points 9 months ago

Having 30min+ incremental compile times here (C++), I envy your situation ahah