File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -495,7 +495,8 @@ pub fn run(mut krate: clean::Crate,
495
495
css_file_extension : Option < PathBuf > ,
496
496
renderinfo : RenderInfo ,
497
497
render_type : RenderType ,
498
- sort_modules_alphabetically : bool ) -> Result < ( ) , Error > {
498
+ sort_modules_alphabetically : bool ,
499
+ deny_render_differences : bool ) -> Result < ( ) , Error > {
499
500
let src_root = match krate. src {
500
501
FileName :: Real ( ref p) => match p. parent ( ) {
501
502
Some ( p) => p. to_path_buf ( ) ,
@@ -659,6 +660,11 @@ pub fn run(mut krate: clean::Crate,
659
660
render_difference ( d, & mut intro_msg, span, text) ;
660
661
}
661
662
}
663
+
664
+ if deny_render_differences {
665
+ println ! ( "Aborting with {} rendering differences" , markdown_warnings. len( ) ) ;
666
+ :: std:: process:: exit ( 1 ) ;
667
+ }
662
668
}
663
669
664
670
result
Original file line number Diff line number Diff line change @@ -257,6 +257,10 @@ pub fn opts() -> Vec<RustcOptGroup> {
257
257
o. optflag( "" , "sort-modules-by-appearance" , "sort modules by where they appear in the \
258
258
program, rather than alphabetically")
259
259
} ) ,
260
+ unstable( "deny-render-differences" , |o| {
261
+ o. optflag( "" , "deny-render-differences" , "abort doc runs when markdown rendering \
262
+ differences are found")
263
+ } ) ,
260
264
]
261
265
}
262
266
@@ -393,6 +397,7 @@ pub fn main_args(args: &[String]) -> isize {
393
397
}
394
398
395
399
let output_format = matches. opt_str ( "w" ) ;
400
+ let deny_render_differences = matches. opt_present ( "deny-render-differences" ) ;
396
401
let res = acquire_input ( PathBuf :: from ( input) , externs, & matches, move |out| {
397
402
let Output { krate, passes, renderinfo } = out;
398
403
info ! ( "going to format" ) ;
@@ -404,7 +409,8 @@ pub fn main_args(args: &[String]) -> isize {
404
409
css_file_extension,
405
410
renderinfo,
406
411
render_type,
407
- sort_modules_alphabetically)
412
+ sort_modules_alphabetically,
413
+ deny_render_differences)
408
414
. expect ( "failed to generate documentation" ) ;
409
415
0
410
416
}
You can’t perform that action at this time.
0 commit comments