@@ -739,7 +739,7 @@ This flag can be passed multiple times to nest wrappers.
739
739
740
740
## Passing arguments to rustc when compiling doctests
741
741
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
743
743
doctest. For example if you have:
744
744
745
745
``` rust,no_run
@@ -784,35 +784,19 @@ failures:
784
784
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
785
785
```
786
786
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 ` :
788
788
789
789
``` console
790
- $ rustdoc --test --doctest_compilation_args =--cap-lints=warn file.rs
790
+ $ rustdoc --test --doctest-build-arg =--cap-lints=warn file.rs
791
791
792
792
running 1 test
793
793
test tests/rustdoc-ui/doctest/rustflags.rs - Bar (line 5) ... ok
794
794
795
795
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s
796
796
```
797
797
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 ` .
816
800
817
801
## ` --generate-macro-expansion ` : Generate macros expansion toggles in source code
818
802
0 commit comments