@@ -4,14 +4,18 @@ use std::path::Path;
44use std:: process:: Command ;
55
66/// Generate documentation for verification targets
7- pub fn exec_doc ( target : & str , verus_conds : bool ) -> Result < ( ) , DynError > {
7+ pub fn exec_doc ( target : & str , verus_conds : bool , verus_conds_debug : bool ) -> Result < ( ) , DynError > {
88 let target_to_use = verus:: find_target ( target) ?;
9- generate_docs ( & target_to_use, verus_conds) ?;
9+ generate_docs ( & target_to_use, verus_conds, verus_conds_debug ) ?;
1010 Ok ( ( ) )
1111}
1212
1313/// Generate documentation for the target including all its dependencies
14- fn generate_docs ( target : & VerusTarget , verus_conds : bool ) -> Result < ( ) , DynError > {
14+ fn generate_docs (
15+ target : & VerusTarget ,
16+ verus_conds : bool ,
17+ verus_conds_debug : bool ,
18+ ) -> Result < ( ) , DynError > {
1519 info ! (
1620 "Generating documentation for {} with all dependencies..." ,
1721 target. name
@@ -26,13 +30,18 @@ fn generate_docs(target: &VerusTarget, verus_conds: bool) -> Result<(), DynError
2630
2731 for ( _name, dep_target) in deps. iter ( ) {
2832 if dep_target. name != target. name {
29- generate_single_target_doc ( dep_target, verus_conds, & doc_output_dir) ?;
33+ generate_single_target_doc (
34+ dep_target,
35+ verus_conds,
36+ verus_conds_debug,
37+ & doc_output_dir,
38+ ) ?;
3039 }
3140 }
3241
33- generate_single_target_doc ( target, verus_conds, & doc_output_dir) ?;
42+ generate_single_target_doc ( target, verus_conds, verus_conds_debug , & doc_output_dir) ?;
3443
35- if verus_conds {
44+ if verus_conds && !verus_conds_debug {
3645 run_verusdoc_postprocessor ( ) ?;
3746 }
3847
@@ -45,6 +54,7 @@ fn generate_docs(target: &VerusTarget, verus_conds: bool) -> Result<(), DynError
4554fn generate_single_target_doc (
4655 target : & VerusTarget ,
4756 verus_conds : bool ,
57+ verus_conds_debug : bool ,
4858 doc_output_dir : & Path ,
4959) -> Result < ( ) , DynError > {
5060 info ! (
@@ -57,8 +67,12 @@ fn generate_single_target_doc(
5767 let target_dir = verus:: get_target_dir ( ) ;
5868 let mut cmd = Command :: new ( "rustdoc" ) ;
5969
60- // Set VERUSDOC environment variable based on verus_conds flag
61- let verus_doc_value = if verus_conds { "1" } else { "0" } ;
70+ // Set VERUSDOC environment variable based on verus_conds flags
71+ let verus_doc_value = if verus_conds || verus_conds_debug {
72+ "1"
73+ } else {
74+ "0"
75+ } ;
6276 cmd. env ( "VERUSDOC" , verus_doc_value) ;
6377 cmd. env ( "RUSTC_BOOTSTRAP" , "1" ) ;
6478
0 commit comments