@@ -158,9 +158,10 @@ tag = "…" # tag name for the git repository
158
158
rev = " …" # revision for the git repository
159
159
160
160
[target .<triple> ]
161
- linker = " …" # linker to use
162
- runner = " …" # wrapper to run executables
163
- rustflags = [" …" , " …" ] # custom flags for `rustc`
161
+ linker = " …" # linker to use
162
+ runner = " …" # wrapper to run executables
163
+ rustflags = [" …" , " …" ] # custom flags for `rustc`
164
+ rustdocflags = [" …" , " …" ] # custom flags for `rustdoc`
164
165
165
166
[target .<cfg> ]
166
167
runner = " …" # wrapper to run executables
@@ -500,15 +501,22 @@ appropriate profile setting.
500
501
Extra command-line flags to pass to ` rustdoc ` . The value may be an array of
501
502
strings or a space-separated string.
502
503
503
- There are three mutually exclusive sources of extra flags. They are checked in
504
+ There are four mutually exclusive sources of extra flags. They are checked in
504
505
order, with the first one being used:
505
506
506
507
1 . ` CARGO_ENCODED_RUSTDOCFLAGS ` environment variable.
507
508
2 . ` RUSTDOCFLAGS ` environment variable.
508
- 3 . ` build.rustdocflags ` config value.
509
+ 3 . All matching ` target.<triple>.rustdocflags ` config entries joined together.
510
+ 4 . ` build.rustdocflags ` config value.
509
511
510
512
Additional flags may also be passed with the [ ` cargo rustdoc ` ] command.
511
513
514
+ > ** Caution** : Due to the low-level nature of passing flags directly to the
515
+ > compiler, this may cause a conflict with future versions of Cargo which may
516
+ > issue the same or similar flags on its own which may interfere with the
517
+ > flags you specify. This is an area where Cargo may not always be backwards
518
+ > compatible.
519
+
512
520
#### ` build.incremental `
513
521
* Type: bool
514
522
* Default: from profile
@@ -1216,6 +1224,17 @@ This is similar to the [target rustflags](#targettriplerustflags), but
1216
1224
using a [ ` cfg() ` expression] . If several ` <cfg> ` and [ ` <triple> ` ] entries
1217
1225
match the current target, the flags are joined together.
1218
1226
1227
+ #### ` target.<triple>.rustdocflags `
1228
+ * Type: string or array of strings
1229
+ * Default: none
1230
+ * Environment: ` CARGO_TARGET_<triple>_RUSTDOCFLAGS `
1231
+
1232
+ Passes a set of custom flags to the compiler for this [ ` <triple> ` ] .
1233
+ The value may be an array of strings or a space-separated string.
1234
+
1235
+ See [ ` build.rustdocflags ` ] ( #buildrustdocflags ) for more details on the different
1236
+ ways to specific extra flags.
1237
+
1219
1238
#### ` target.<triple>.<links> `
1220
1239
1221
1240
The links sub-table provides a way to [ override a build script] . When
0 commit comments