Skip to content

Commit b1228b0

Browse files
committed
Add Required Components for rustc_private in unstable book
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
1 parent 2c6a12e commit b1228b0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/doc/unstable-book/src/language-features/rustc-private.md

+23
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,26 @@ The presence of this feature changes the way the linkage format for dylibs is ca
1212
that is necessary for linking against dylibs that statically link `std` (such as `rustc_driver`).
1313
This makes this feature "viral" in linkage; its use in a given crate makes its use required in
1414
dependent crates which link to it (including integration tests, which are built as separate crates).
15+
16+
17+
18+
### Required Components
19+
20+
To use the `rustc_private` feature, you need to install:
21+
22+
1. The `rustc-dev` component (provides compiler libraries)
23+
2. The `llvm-tools` component (provides LLVM libraries needed for linking)
24+
25+
You can install these components using `rustup`:
26+
27+
```
28+
rustup component add rustc-dev llvm-tools
29+
```
30+
31+
Without the `llvm-tools` component, you may encounter linking errors like:
32+
33+
```
34+
error: linking with `cc` failed: exit status: 1
35+
|
36+
= note: rust-lld: error: unable to find library -lLLVM-{version}
37+
```

0 commit comments

Comments
 (0)