Skip to content

Commit a61c419

Browse files
Merge pull request #20638 from Kobzol/book-share-cache
Add a FAQ entry about RA and Cargo build lock/cache conflicts
2 parents 9edc9cb + e5a51cc commit a61c419

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

docs/book/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ To run the documentation site locally:
88

99
```shell
1010
cargo install mdbook
11+
cargo install mdbook-toc
1112
cargo xtask codegen
1213
cd docs/book
1314
mdbook serve

docs/book/src/faq.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,12 @@
55
rust-analyzer fails to resolve `None`, and thinks you are binding to a variable
66
named `None`. That's usually a sign of a corrupted sysroot. Try removing and re-installing
77
it: `rustup component remove rust-src` then `rustup component install rust-src`.
8+
9+
### Rust Analyzer and Cargo compete over the build lock
10+
11+
Rust Analyzer invokes Cargo in the background, and it can thus block manually executed
12+
`cargo` commands from making progress (or vice-versa). In some cases, this can also cause
13+
unnecessary recompilations caused by cache thrashing. To avoid this, you can configure
14+
Rust Analyzer to use a [different target directory](./configuration.md#cargo.targetDir).
15+
This will allow both the IDE and Cargo to make progress independently, at the cost of
16+
increased disk space usage caused by the duplicated artifact directories.

0 commit comments

Comments
 (0)