@@ -160,6 +160,9 @@ pub(crate) struct Options {
160
160
/// the compiler will scrape examples and not generate documentation.
161
161
pub ( crate ) scrape_examples_options : Option < ScrapeExamplesOptions > ,
162
162
163
+ /// Whether to generate documentation for tests.
164
+ pub ( crate ) document_tests : bool ,
165
+
163
166
/// Note: this field is duplicated in `RenderOptions` because it's useful
164
167
/// to have it in both places.
165
168
pub ( crate ) unstable_features : rustc_feature:: UnstableFeatures ,
@@ -213,6 +216,7 @@ impl fmt::Debug for Options {
213
216
. field ( "test_builder_wrappers" , & self . test_builder_wrappers )
214
217
. field ( "nocapture" , & self . nocapture )
215
218
. field ( "scrape_examples_options" , & self . scrape_examples_options )
219
+ . field ( "document_tests" , & self . document_tests )
216
220
. field ( "unstable_features" , & self . unstable_features )
217
221
. finish ( )
218
222
}
@@ -732,6 +736,7 @@ impl Options {
732
736
}
733
737
734
738
let scrape_examples_options = ScrapeExamplesOptions :: new ( matches, & dcx) ;
739
+ let document_tests = matches. opt_present ( "document-tests" ) ;
735
740
let with_examples = matches. opt_strs ( "with-examples" ) ;
736
741
let call_locations = crate :: scrape_examples:: load_call_locations ( with_examples, & dcx) ;
737
742
@@ -777,6 +782,7 @@ impl Options {
777
782
output_format,
778
783
json_unused_externs,
779
784
scrape_examples_options,
785
+ document_tests,
780
786
unstable_features,
781
787
expanded_args : args,
782
788
} ;
0 commit comments