diff options
| author | Timothée Gerber <contact@timotheegerber.fr> | 2020-03-26 22:57:33 +0100 |
|---|---|---|
| committer | Timothée Gerber <contact@timotheegerber.fr> | 2020-03-26 23:06:17 +0100 |
| commit | 6a744ea4d515a70c5c90fef85cfa4c7ba8ae7f53 (patch) | |
| tree | ed723f7b51972077b6b111e491b3865d2087d35c | |
| parent | 2fbb07525e2f07a815e780a4268b11916248b5a9 (diff) | |
| download | rust-6a744ea4d515a70c5c90fef85cfa4c7ba8ae7f53.tar.gz rust-6a744ea4d515a70c5c90fef85cfa4c7ba8ae7f53.zip | |
Create output dir in rustdoc markdown render
| -rw-r--r-- | src/librustdoc/markdown.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs index a41fdd2ff17..0a1b5f58815 100644 --- a/src/librustdoc/markdown.rs +++ b/src/librustdoc/markdown.rs @@ -1,4 +1,4 @@ -use std::fs::File; +use std::fs::{create_dir_all, File}; use std::io::prelude::*; use std::path::PathBuf; @@ -40,6 +40,11 @@ pub fn render( diag: &rustc_errors::Handler, edition: Edition, ) -> i32 { + if let Err(e) = create_dir_all(&options.output) { + diag.struct_err(&format!("{}: {}", options.output.display(), e)).emit(); + return 4; + } + let mut output = options.output; output.push(input.file_name().unwrap()); output.set_extension("html"); |
