Skip to content

Commit 9fee524

Browse files
authored
Unrolled build for #147013
Rollup merge of #147013 - fmease:fix-docs-doctest-build-arg, r=GuillaumeGomez rustdoc: Fix documentation for `--doctest-build-arg` In #139863, I forgot to update the documentation. Tracking issue: #134172
2 parents 7cfd7d3 + 932f3a8 commit 9fee524

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

src/doc/rustdoc/src/unstable-features.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ This flag can be passed multiple times to nest wrappers.
739739

740740
## Passing arguments to rustc when compiling doctests
741741

742-
You can use the `--doctest-compilation-args` flag if you want to add options when compiling the
742+
You can use the `--doctest-build-arg` flag if you want to add options when compiling the
743743
doctest. For example if you have:
744744

745745
```rust,no_run
@@ -784,35 +784,19 @@ failures:
784784
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
785785
```
786786

787-
But if you can limit the lint level to warning by using `--doctest_compilation_args=--cap-lints=warn`:
787+
But if you can limit the lint level to warning by using `--doctest-build-arg=--cap-lints=warn`:
788788

789789
```console
790-
$ rustdoc --test --doctest_compilation_args=--cap-lints=warn file.rs
790+
$ rustdoc --test --doctest-build-arg=--cap-lints=warn file.rs
791791

792792
running 1 test
793793
test tests/rustdoc-ui/doctest/rustflags.rs - Bar (line 5) ... ok
794794

795795
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s
796796
```
797797

798-
The parsing of arguments works as follows: if it encounters a `"` or a `'`, it will continue
799-
until it finds the character unescaped (without a prepending `\`). If not inside a string, a
800-
whitespace character will also split arguments. Example:
801-
802-
```text
803-
"hello 'a'\" ok" how are 'you today?'
804-
```
805-
806-
will be split as follows:
807-
808-
```text
809-
[
810-
"hello 'a'\" ok",
811-
"how",
812-
"are",
813-
"you today?",
814-
]
815-
```
798+
In order to pass multiple arguments to the underlying compiler,
799+
pass `--doctest-build-arg ARG` for each argument `ARG`.
816800

817801
## `--generate-macro-expansion`: Generate macros expansion toggles in source code
818802

0 commit comments

Comments
 (0)