Skip to content

Commit 6a744ea

Browse files
Create output dir in rustdoc markdown render
1 parent 2fbb075 commit 6a744ea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustdoc/markdown.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::fs::File;
1+
use std::fs::{create_dir_all, File};
22
use std::io::prelude::*;
33
use std::path::PathBuf;
44

@@ -40,6 +40,11 @@ pub fn render(
4040
diag: &rustc_errors::Handler,
4141
edition: Edition,
4242
) -> i32 {
43+
if let Err(e) = create_dir_all(&options.output) {
44+
diag.struct_err(&format!("{}: {}", options.output.display(), e)).emit();
45+
return 4;
46+
}
47+
4348
let mut output = options.output;
4449
output.push(input.file_name().unwrap());
4550
output.set_extension("html");

0 commit comments

Comments
 (0)