@@ -4,6 +4,8 @@ mod markdown;
44mod  runner; 
55mod  rust; 
66
7+ #[ cfg( bootstrap) ]  
8+ use  std:: fmt; 
79use  std:: fs:: File ; 
810use  std:: hash:: { Hash ,  Hasher } ; 
911use  std:: io:: { self ,  Write } ; 
@@ -30,6 +32,7 @@ use rustc_span::symbol::sym;
3032use  rustc_span:: { FileName ,  Span } ; 
3133use  rustc_target:: spec:: { Target ,  TargetTuple } ; 
3234use  tempfile:: { Builder  as  TempFileBuilder ,  TempDir } ; 
35+ #[ cfg( not( bootstrap) ) ]  
3336use  test:: test:: { RustdocResult ,  get_rustdoc_result} ; 
3437use  tracing:: debug; 
3538
@@ -38,6 +41,37 @@ use crate::config::{Options as RustdocOptions, OutputFormat};
3841use  crate :: html:: markdown:: { ErrorCodes ,  Ignore ,  LangString ,  MdRelLine } ; 
3942use  crate :: lint:: init_lints; 
4043
44+ #[ cfg( bootstrap) ]  
45+ pub  enum  RustdocResult  { 
46+     /// The test failed to compile. 
47+ CompileError , 
48+     /// The test is marked `compile_fail` but compiled successfully. 
49+ UnexpectedCompilePass , 
50+     /// The test failed to compile (as expected) but the compiler output did not contain all 
51+ /// expected error codes. 
52+ MissingErrorCodes ( Vec < String > ) , 
53+     /// The test binary was unable to be executed. 
54+ ExecutionError ( io:: Error ) , 
55+     /// The test binary exited with a non-zero exit code. 
56+ /// 
57+ /// This typically means an assertion in the test failed or another form of panic occurred. 
58+ ExecutionFailure ( Output ) , 
59+     /// The test is marked `should_panic` but the test binary executed successfully. 
60+ NoPanic ( Option < String > ) , 
61+ } 
62+ 
63+ #[ cfg( bootstrap) ]  
64+ impl  fmt:: Display  for  RustdocResult  { 
65+     fn  fmt ( & self ,  f :  & mut  fmt:: Formatter < ' _ > )  -> fmt:: Result  { 
66+         Ok ( ( ) ) 
67+     } 
68+ } 
69+ 
70+ #[ cfg( bootstrap) ]  
71+ fn  get_rustdoc_result ( _:  process:: Output ,  _:  bool )  -> Result < ( ) ,  RustdocResult >  { 
72+     Ok ( ( ) ) 
73+ } 
74+ 
4175/// Type used to display times (compilation and total) information for merged doctests. 
4276struct  MergedDoctestTimes  { 
4377    total_time :  Instant , 
0 commit comments