We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9e1dea commit 6fd7462Copy full SHA for 6fd7462
src/doc/rustc/src/targets/custom.md
@@ -15,3 +15,14 @@ rustc +nightly -Z unstable-options --target=wasm32-unknown-unknown --print targe
15
```
16
17
To use a custom target, see the (unstable) [`build-std` feature](../../cargo/reference/unstable.html#build-std) of `cargo`.
18
+
19
+## Custom Target Lookup Path
20
21
+When `rustc` is given an option `--target=TARGET` (where `TARGET` is any string), it uses the following logic:
22
+1. if `TARGET` is the name of a built-in target, use that
23
+2. if `TARGET` is a path to a file, read that file as a json target
24
+3. otherwise, search the colon-seperated list of directories found
25
+ in the `RUST_TARGET_PATH` environment variable for a file named
26
+ `TARGET.json`.
27
28
+If none of these methods find a target, an error is thrown.
0 commit comments