Skip to content

Commit e7f58b4

Browse files
authored
Merge --print cfg with existing note block
1 parent 22bba4c commit e7f58b4

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/conditional-compilation.md

+1-13
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ passed to the compiler outside of the code. It is not possible to set a
4949
configuration option from within the source code of the crate being compiled.
5050

5151
> **Note**: For `rustc`, arbitrary-set configuration options are set using the
52-
> [`--cfg`] flag.
52+
> [`--cfg`] flag. Configuration values for a specified target can be displayed with `rustc --print cfg --target $TARGET`.
5353
5454
> **Note**: Configuration options with the key `feature` are a convention used
5555
> by [Cargo][cargo-feature] for specifying compile-time options and optional
@@ -58,18 +58,6 @@ configuration option from within the source code of the crate being compiled.
5858
> [!WARNING]
5959
> Arbitrarily-set configuration options can clash with compiler-set configuration options. For example, it is possible to do `rustc --cfg "unix" program.rs` while compiling to a Windows target, and have both `unix` and `windows` configuration options set at the same time. Doing this would be unwise.
6060
61-
Some default configuration values can be obtained from `rustc`:
62-
63-
```text
64-
rustc --print cfg # optionally, a --target can be specified
65-
target_abi=""
66-
target_arch="aarch64"
67-
target_endian="little"
68-
target_env=""
69-
target_family="unix"
70-
...
71-
```
72-
7361
### `target_arch`
7462

7563
Key-value option set once with the target's CPU architecture. The value is

0 commit comments

Comments
 (0)