Improve documentation for internal doctest API

This commit is contained in:
Guillaume Gomez 2024-07-09 14:24:04 +02:00
parent baf8ce83b8
commit c9f730e223

View File

@ -456,6 +456,10 @@ fn path_for_merged_doctest(&self) -> PathBuf {
}
}
/// Execute a `RunnableDoctest`.
///
/// This is the function that calculates the compiler command line, invokes the compiler, then
/// invokes the test or tests in a separate executable (if applicable).
fn run_test(
doctest: RunnableDocTest,
rustdoc_options: &RustdocOptions,
@ -705,6 +709,15 @@ fn new(options: &RustdocOptions, test_id: &Option<String>, test_path: PathBuf) -
}
/// A doctest scraped from the code, ready to be turned into a runnable test.
///
/// The pipeline goes: [`clean`] AST -> `ScrapedDoctest` -> [`RunnableDoctest`].
/// [`run_merged_tests`] converts a bunch of scraped doctests to a single runnable doctest,
/// while [`generate_unique_doctest`] does the standalones.
///
/// [`clean`]: crate::clean
/// [`RunnableDoctest`]: crate::doctest::RunnableDoctest
/// [`run_merged_tests`]: crate::doctest::runner::DocTestRunner::run_merged_tests
/// [`generate_unique_doctest`]: crate::doctest::make::DocTestBuilder::generate_unique_doctest
pub(crate) struct ScrapedDocTest {
filename: FileName,
line: usize,