Skip to content

Commit 439161b

Browse files
Fix stage 1 build
1 parent b292354 commit 439161b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/librustdoc/doctest.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use rustc_span::symbol::sym;
3030
use rustc_span::{FileName, Span};
3131
use rustc_target::spec::{Target, TargetTuple};
3232
use tempfile::{Builder as TempFileBuilder, TempDir};
33+
#[cfg(not(bootstrap))]
3334
use test::test::{RustdocResult, get_rustdoc_result};
3435
use tracing::debug;
3536

@@ -38,6 +39,30 @@ use crate::config::{Options as RustdocOptions, OutputFormat};
3839
use crate::html::markdown::{ErrorCodes, Ignore, LangString, MdRelLine};
3940
use crate::lint::init_lints;
4041

42+
#[cfg(bootstrap)]
43+
pub enum RustdocResult {
44+
/// The test failed to compile.
45+
CompileError,
46+
/// The test is marked `compile_fail` but compiled successfully.
47+
UnexpectedCompilePass,
48+
/// The test failed to compile (as expected) but the compiler output did not contain all
49+
/// expected error codes.
50+
MissingErrorCodes(Vec<String>),
51+
/// The test binary was unable to be executed.
52+
ExecutionError(io::Error),
53+
/// The test binary exited with a non-zero exit code.
54+
///
55+
/// This typically means an assertion in the test failed or another form of panic occurred.
56+
ExecutionFailure(Output),
57+
/// The test is marked `should_panic` but the test binary executed successfully.
58+
NoPanic(Option<String>),
59+
}
60+
61+
#[cfg(bootstrap)]
62+
fn get_rustdoc_result(_: process::Output, _: bool) -> Result<(), RustdocResult> {
63+
Ok(())
64+
}
65+
4166
/// Type used to display times (compilation and total) information for merged doctests.
4267
struct MergedDoctestTimes {
4368
total_time: Instant,

0 commit comments

Comments
 (0)