fn run_ext_doc(self, builder: &Builder<'_>) {
        let compiler = self.compiler;

        builder.ensure(compile::Std { compiler, target: compiler.host });

        // mdbook just executes a binary named "rustdoc", so we need to update
        // PATH so that it points to our rustdoc.
        let mut rustdoc_path = builder.rustdoc(compiler);
        rustdoc_path.pop();
        let old_path = env::var_os("PATH").unwrap_or_default();
        let new_path = env::join_paths(iter::once(rustdoc_path).chain(env::split_paths(&old_path)))
            .expect("could not add rustdoc to PATH");

        let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook);
        let path = builder.src.join(&self.path);
        rustbook_cmd.env("PATH", new_path).arg("test").arg(path);
        builder.add_rust_test_threads(&mut rustbook_cmd);
        builder.info(&format!("Testing rustbook {}", self.path.display()));
        let _time = util::timeit(&builder);
        let toolstate = if try_run(builder, &mut rustbook_cmd) {
            ToolState::TestPass
        } else {
            ToolState::TestFail
        };
        builder.save_toolstate(self.name, toolstate);
    }
/// This runs the equivalent of `mdbook test` (via the rustbook wrapper)
/// which in turn runs `rustdoc --test` on each file in the book.
This runs the equivalent of `mdbook test` (via the rustbook wrapper)
which in turn runs `rustdoc --test` on each file in the book.
This runs the equivalent of ` mdbook test ` ( via the rustbook wrapper ) which in turn runs ` rustdoc -- test ` on each file in the book .
fn run_ext_doc(self, builder: &Builder<'_>) {
        let compiler = self.compiler;
        builder.ensure(compile::Std { compiler, target: compiler.host });
        // mdbook just executes a binary named "rustdoc", so we need to update
        // PATH so that it points to our rustdoc.
        let mut rustdoc_path = builder.rustdoc(compiler);
        rustdoc_path.pop();
        let old_path = env::var_os("PATH").unwrap_or_default();
        let new_path = env::join_paths(iter::once(rustdoc_path).chain(env::split_paths(&old_path)))
            .expect("could not add rustdoc to PATH");
        let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook);
        let path = builder.src.join(&self.path);
        rustbook_cmd.env("PATH", new_path).arg("test").arg(path);
        builder.add_rust_test_threads(&mut rustbook_cmd);
        builder.info(&format!("Testing rustbook {}", self.path.display()));
        let _time = util::timeit(&builder);
        let toolstate = if try_run(builder, &mut rustbook_cmd) {
            ToolState::TestPass
        } else {
            ToolState::TestFail
        };
        builder.save_toolstate(self.name, toolstate);
    }
fn run_ext_doc ( self , builder : & Builder < ' _ > ) { let compiler = self . compiler ; builder . ensure ( compile :: Std { compiler , target : compiler . host } ) ; // mdbook just executes a binary named "rustdoc", so we need to update // PATH so that it points to our rustdoc. let mut rustdoc_path = builder . rustdoc ( compiler ) ; rustdoc_path . pop ( ) ; let old_path = env :: var_os ( " " ) . unwrap_or_default ( ) ; let new_path = env :: join_paths ( iter :: once ( rustdoc_path ) . chain ( env :: split_paths ( & old_path ) ) ) . expect ( " " ) ; let mut rustbook_cmd = builder . tool_cmd ( Tool :: Rustbook ) ; let path = builder . src . join ( & self . path ) ; rustbook_cmd . env ( " " , new_path ) . arg ( " " ) . arg ( path ) ; builder . add_rust_test_threads ( & mut rustbook_cmd ) ; builder . info ( & format ! ( " " self path display ( ) ) ) ; let _time = util :: timeit ( & builder ) ; let toolstate = if try_run ( builder , & mut rustbook_cmd ) { ToolState :: TestPass } else { ToolState :: TestFail } ; builder . save_toolstate ( self . name , toolstate ) ; }
This runs the equivalent of `mdbook test` (via the rustbook wrapper)
which in turn runs `rustdoc --test` on each file in the book.
This runs the equivalent of ` mdbook test ` ( via the rustbook wrapper ) which in turn runs ` rustdoc -- test ` on each file in the book .
self
builder
&Builder<'_>
self
builder
&Builder<'_>