Skip to content

Commit 36d92ac

Browse files
committed
external-rustc-drivers.md: some improvements
1 parent 8de2a11 commit 36d92ac

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

src/rustc-driver/external-rustc-drivers.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,28 @@ For custom-built toolchains or environments not using rustup, additional configu
4242

4343
#### Troubleshooting Steps
4444

45-
1. **Check LLVM installation**: Verify LLVM is installed and accessible
46-
2. **Configure library paths**: You may need to set environment variables:
47-
```text
45+
1. Verify LLVM is installed and accessible
46+
2. Ensure that library paths are set:
47+
```sh
4848
export LD_LIBRARY_PATH=/path/to/llvm/lib:$LD_LIBRARY_PATH
4949
```
50-
3. **Check version compatibility**: Ensure your LLVM version is compatible with your Rust toolchain
50+
3. Ensure your LLVM version is compatible with your Rust toolchain
5151

52-
### Configuring `rust-analyzer` for Out-of-Tree Projects
52+
### Configuring `rust-analyzer` for out-of-tree projects
5353

5454
When developing out-of-tree projects that use `rustc_private` crates, you can configure `rust-analyzer` to recognize these crates.
5555

5656
#### Configuration Steps
5757

58-
1. **Set rust-analyzer configuration**
59-
Configure `rust-analyzer.rustc.source` to `"discover"` in your editor settings.
58+
1. Configure `rust-analyzer.rustc.source` to `"discover"` in your editor settings.
6059
For VS Code, add to `rust_analyzer_settings.json`:
6160
```json
6261
{
6362
"rust-analyzer.rustc.source": "discover"
6463
}
6564
```
66-
2. **Add metadata to Cargo.toml**
67-
Add the following to the `Cargo.toml` of every crate that uses `rustc_private`:
65+
66+
2. Add the following to the `Cargo.toml` of every crate that uses `rustc_private`:
6867
```toml
6968
[package.metadata.rust-analyzer]
7069
rustc_private = true
@@ -74,4 +73,6 @@ This configuration allows `rust-analyzer` to properly recognize and provide IDE
7473

7574
### Additional Resources
7675

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
76+
- [GitHub Issue #137421] explains that `rustc_private` linker failures often occur because `llvm-tools` is not installed
77+
78+
[GitHub Issue #137421]: https://github.com/rust-lang/rust/issues/137421

0 commit comments

Comments
 (0)