diff --git a/src/book/mod.rs b/src/book/mod.rs index 80587e5a..f35545b1 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -245,7 +245,12 @@ impl MDBook { } /// Run `rustdoc` tests on the book, linking against the provided libraries. - pub fn test(&mut self, library_paths: Vec<&str>, externs: Vec<&str>, verbose: bool) -> Result<()> { + pub fn test( + &mut self, + library_paths: Vec<&str>, + externs: Vec<&str>, + verbose: bool, + ) -> Result<()> { let library_args: Vec<&str> = (0..library_paths.len()) .map(|_| "-L") .zip(library_paths.into_iter()) @@ -287,8 +292,7 @@ impl MDBook { tmpf.write_all(ch.content.as_bytes())?; let mut cmd = Command::new("rustdoc"); - cmd - .arg(&path) + cmd.arg(&path) .arg("--test") .args(&library_args) .args(&extern_args) @@ -306,6 +310,8 @@ impl MDBook { cmd.args(&["--edition", "2021"]); } } + } else { + warn!("Edition not set in book.toml [rust] section. Rustdoc will default to 2015, which probably not what you want."); } let command = cmd diff --git a/src/cmd/test.rs b/src/cmd/test.rs index 7901a631..99a3112f 100644 --- a/src/cmd/test.rs +++ b/src/cmd/test.rs @@ -51,7 +51,7 @@ pub fn make_subcommand<'help>() -> App<'help> { .arg(Arg::with_name("verbose") .long("verbose") .short("v") - .takes_value(false) + .takes_value(false) .multiple(false) .help("Enables verbose logging with the test command.")) }