@@ -160,6 +160,9 @@ pub(crate) struct Options {
160160 /// the compiler will scrape examples and not generate documentation.
161161 pub ( crate ) scrape_examples_options : Option < ScrapeExamplesOptions > ,
162162
163+ /// Whether to generate documentation for tests.
164+ pub ( crate ) document_tests : bool ,
165+
163166 /// Note: this field is duplicated in `RenderOptions` because it's useful
164167 /// to have it in both places.
165168 pub ( crate ) unstable_features : rustc_feature:: UnstableFeatures ,
@@ -213,6 +216,7 @@ impl fmt::Debug for Options {
213216 . field ( "test_builder_wrappers" , & self . test_builder_wrappers )
214217 . field ( "nocapture" , & self . nocapture )
215218 . field ( "scrape_examples_options" , & self . scrape_examples_options )
219+ . field ( "document_tests" , & self . document_tests )
216220 . field ( "unstable_features" , & self . unstable_features )
217221 . finish ( )
218222 }
@@ -732,6 +736,7 @@ impl Options {
732736 }
733737
734738 let scrape_examples_options = ScrapeExamplesOptions :: new ( matches, & dcx) ;
739+ let document_tests = matches. opt_present ( "document-tests" ) ;
735740 let with_examples = matches. opt_strs ( "with-examples" ) ;
736741 let call_locations = crate :: scrape_examples:: load_call_locations ( with_examples, & dcx) ;
737742
@@ -777,6 +782,7 @@ impl Options {
777782 output_format,
778783 json_unused_externs,
779784 scrape_examples_options,
785+ document_tests,
780786 unstable_features,
781787 expanded_args : args,
782788 } ;
0 commit comments