@@ -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,38 @@ 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+ #[ allow( dead_code) ]
46+ pub enum RustdocResult {
47+ /// The test failed to compile.
48+ CompileError ,
49+ /// The test is marked `compile_fail` but compiled successfully.
50+ UnexpectedCompilePass ,
51+ /// The test failed to compile (as expected) but the compiler output did not contain all
52+ /// expected error codes.
53+ MissingErrorCodes ( Vec < String > ) ,
54+ /// The test binary was unable to be executed.
55+ ExecutionError ( io:: Error ) ,
56+ /// The test binary exited with a non-zero exit code.
57+ ///
58+ /// This typically means an assertion in the test failed or another form of panic occurred.
59+ ExecutionFailure ( process:: Output ) ,
60+ /// The test is marked `should_panic` but the test binary executed successfully.
61+ NoPanic ( Option < String > ) ,
62+ }
63+
64+ #[ cfg( bootstrap) ]
65+ impl fmt:: Display for RustdocResult {
66+ fn fmt ( & self , _: & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
67+ Ok ( ( ) )
68+ }
69+ }
70+
71+ #[ cfg( bootstrap) ]
72+ fn get_rustdoc_result ( _: process:: Output , _: bool ) -> Result < ( ) , RustdocResult > {
73+ Ok ( ( ) )
74+ }
75+
4176/// Type used to display times (compilation and total) information for merged doctests.
4277struct MergedDoctestTimes {
4378 total_time : Instant ,
0 commit comments