Skip to content

Commit 05e6d6f

Browse files
committed
added links to 'target' glossary entry in documentation for configuration section of the reference
1 parent 7f0ee92 commit 05e6d6f

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/doc/src/reference/config.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ all capital letters.
321321

322322
This section documents all configuration keys. The description for keys with
323323
variable parts are annotated with angled brackets like `target.<triple>` where
324-
the `<triple>` part can be any target triple like
324+
the [`<triple>`] part can be any [target triple] like
325325
`target.x86_64-pc-windows-msvc`.
326326

327327
#### `paths`
@@ -418,7 +418,7 @@ Sets the executable to use for `rustdoc`.
418418
* Default: host platform
419419
* Environment: `CARGO_BUILD_TARGET`
420420

421-
The default target platform triples to compile to.
421+
The default [target platform triples][target triple] to compile to.
422422

423423
This allows passing either a string or an array of strings. Each string value
424424
is a target platform triple. The selected build targets will be built for each
@@ -468,7 +468,7 @@ for the host, such as build scripts or proc macros, will not receive the args.
468468
Without `--target`, the flags will be passed to all compiler invocations
469469
(including build scripts and proc macros) because dependencies are shared. If
470470
you have args that you do not want to pass to build scripts or proc macros and
471-
are building for the host, pass `--target` with the host triple.
471+
are building for the host, pass `--target` with the [host triple][target triple].
472472

473473
It is not recommended to pass in flags that Cargo itself usually manages. For
474474
example, the flags driven by [profiles](profiles.md) are best handled by setting the
@@ -1048,9 +1048,9 @@ If none of `branch`, `tag`, or `rev` is set, defaults to the `master` branch.
10481048
#### `[target]`
10491049

10501050
The `[target]` table is used for specifying settings for specific platform
1051-
targets. It consists of a sub-table which is either a platform triple or a
1052-
[`cfg()` expression]. The given values will be used if the target platform
1053-
matches either the `<triple>` value or the `<cfg>` expression.
1051+
targets. It consists of a sub-table which is either a [platform triple][target triple]
1052+
or a [`cfg()` expression]. The given values will be used if the target platform
1053+
matches either the [`<triple>`] value or the `<cfg>` expression.
10541054

10551055
```toml
10561056
[target.thumbv7m-none-eabi]
@@ -1068,7 +1068,7 @@ to view), values set by [build scripts], and extra `--cfg` flags passed to
10681068
`rustc` (such as those defined in `RUSTFLAGS`). Do not try to match on
10691069
`debug_assertions` or Cargo features like `feature="foo"`.
10701070

1071-
If using a target spec JSON file, the `<triple>` value is the filename stem.
1071+
If using a target spec JSON file, the [`<triple>`] value is the filename stem.
10721072
For example `--target foo/bar.json` would match `[target.bar]`.
10731073

10741074
##### `target.<triple>.ar`
@@ -1081,22 +1081,22 @@ This option is deprecated and unused.
10811081
* Environment: `CARGO_TARGET_<triple>_LINKER`
10821082

10831083
Specifies the linker which is passed to `rustc` (via [`-C linker`]) when the
1084-
`<triple>` is being compiled for. By default, the linker is not overridden.
1084+
[`<triple>`] is being compiled for. By default, the linker is not overridden.
10851085

10861086
##### `target.<triple>.runner`
10871087
* Type: string or array of strings ([program path with args])
10881088
* Default: none
10891089
* Environment: `CARGO_TARGET_<triple>_RUNNER`
10901090

1091-
If a runner is provided, executables for the target `<triple>` will be
1091+
If a runner is provided, executables for the target [`<triple>`] will be
10921092
executed by invoking the specified runner with the actual executable passed as
10931093
an argument. This applies to [`cargo run`], [`cargo test`] and [`cargo bench`]
10941094
commands. By default, compiled executables are executed directly.
10951095

10961096
##### `target.<cfg>.runner`
10971097

10981098
This is similar to the [target runner](#targettriplerunner), but using
1099-
a [`cfg()` expression]. If both a `<triple>` and `<cfg>` runner match,
1099+
a [`cfg()` expression]. If both a [`<triple>`] and `<cfg>` runner match,
11001100
the `<triple>` will take precedence. It is an error if more than one
11011101
`<cfg>` runner matches the current target.
11021102

@@ -1105,16 +1105,16 @@ the `<triple>` will take precedence. It is an error if more than one
11051105
* Default: none
11061106
* Environment: `CARGO_TARGET_<triple>_RUSTFLAGS`
11071107

1108-
Passes a set of custom flags to the compiler for this `<triple>`. The value
1109-
may be an array of strings or a space-separated string.
1108+
Passes a set of custom flags to the compiler for this [`<triple>`].
1109+
The value may be an array of strings or a space-separated string.
11101110

11111111
See [`build.rustflags`](#buildrustflags) for more details on the different
11121112
ways to specific extra flags.
11131113

11141114
##### `target.<cfg>.rustflags`
11151115

11161116
This is similar to the [target rustflags](#targettriplerustflags), but
1117-
using a [`cfg()` expression]. If several `<cfg>` and `<triple>` entries
1117+
using a [`cfg()` expression]. If several `<cfg>` and [`<triple>`] entries
11181118
match the current target, the flags are joined together.
11191119

11201120
##### `target.<triple>.<links>`
@@ -1214,3 +1214,5 @@ Sets the width for progress bar.
12141214
[revision]: https://git-scm.com/docs/gitrevisions
12151215
[registries]: registries.md
12161216
[crates.io]: https://crates.io/
1217+
[target triple]: ../appendix/glossary.md#target '"target" (glossary)'
1218+
[`<triple>`]: ../appendix/glossary.md#target '"target" (glossary)'

0 commit comments

Comments
 (0)