@@ -455,3 +455,53 @@ Some methodology notes about what rustdoc counts in this metric:
455455
456456Public items that are not documented can be seen with the built-in ` missing_docs ` lint. Private
457457items that are not documented can be seen with Clippy's ` missing_docs_in_private_items ` lint.
458+
459+ ### ` --enable-per-target-ignores ` : allow ` ignore-foo ` style filters for doctests
460+
461+ Using this flag looks like this:
462+
463+ ``` bash
464+ $ rustdoc src/lib.rs -Z unstable-options --enable-per-target-ignores
465+ ```
466+
467+ This flag allows you to tag doctests with compiltest style ` ignore-foo ` filters that prevent
468+ rustdoc from running that test if the target triple string contains foo. For example:
469+
470+ ``` rust
471+ /// ```ignore-foo,ignore-bar
472+ /// assert!(2 == 2);
473+ /// ```
474+ struct Foo ;
475+ ```
476+
477+ This will not be run when the build target is ` super-awesome-foo ` or ` less-bar-awesome ` .
478+ If the flag is not enabled, then rustdoc will consume the filter, but do nothing with it, and
479+ the above example will be run for all targets.
480+ If you want to preserve backwards compatibility for older versions of rustdoc, you can use
481+
482+ ``` rust
483+ /// ```ignore,ignore-foo
484+ /// assert!(2 == 2);
485+ /// ```
486+ struct Foo ;
487+ ```
488+
489+ In older versions, this will be ignored on all targets, but on newer versions ` ignore-gnu ` will
490+ override ` ignore ` .
491+
492+ ### ` --runtool ` , ` --runtool-arg ` : program to run tests with; args to pass to it
493+
494+ Using thses options looks like this:
495+
496+ ``` bash
497+ $ rustdoc src/lib.rs -Z unstable-options --runtool runner --runtool-arg --do-thing --runtool-arg --do-other-thing
498+ ```
499+
500+ These options can be used to run the doctest under a program, and also pass arguments to
501+ that program. For example, if you want to run your doctests under valgrind you might run
502+
503+ ``` bash
504+ $ rustdoc src/lib.rs -Z unstable-options --runtool valgrind
505+ ```
506+
507+ Another use case would be to run a test inside an emulator, or through a Virtual Machine.
0 commit comments