You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/rustc-driver/remarks-on-perma-unstable-features.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,29 @@ For custom-built toolchains or environments not using rustup, additional configu
49
49
```
50
50
3.**Check version compatibility**: Ensure your LLVM version is compatible with your Rust toolchain
51
51
52
+
### Configuring `rust-analyzer` for Out-of-Tree Projects
53
+
54
+
When developing out-of-tree projects that use `rustc_private` crates, you can configure `rust-analyzer` to recognize these crates.
55
+
56
+
#### Configuration Steps
57
+
58
+
1.**Set rust-analyzer configuration**
59
+
Configure `rust-analyzer.rustc.source` to `"discover"` in your editor settings.
60
+
For VS Code, add to `rust_analyzer_settings.json`:
61
+
```json
62
+
{
63
+
"rust-analyzer.rustc.source": "discover"
64
+
}
65
+
```
66
+
2.**Add metadata to Cargo.toml**
67
+
Add the following to the `Cargo.toml` of every crate that uses `rustc_private`:
68
+
```toml
69
+
[package.metadata.rust-analyzer]
70
+
rustc_private = true
71
+
```
72
+
73
+
This configuration allows `rust-analyzer` to properly recognize and provide IDE support for `rustc_private` crates in out-of-tree projects.
74
+
52
75
### Additional Resources
53
76
54
77
-[GitHub Issue #137421](https://github.com/rust-lang/rust/issues/137421): Explains that `rustc_private` linker failures often occur because `llvm-tools` is not installed
0 commit comments