Skip to content

Commit

Permalink
rustdoc: fix 98690
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkforest committed Jun 30, 2022
1 parent 7b68106 commit 29e0e14
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustdoc/doctest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1003,8 +1003,10 @@ impl Tester for Collector {
let outdir = if let Some(mut path) = rustdoc_options.persist_doctests.clone() {
path.push(&test_id);

std::fs::create_dir_all(&path)
.expect("Couldn't create directory for doctest executables");
if let Err(err) = std::fs::create_dir_all(&path) {
eprintln!("Couldn't create directory for doctest executables: {}", err);
panic::resume_unwind(box ());
}

DirState::Perm(path)
} else {
Expand Down
9 changes: 9 additions & 0 deletions src/test/rustdoc-ui/issue-98690.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// compile-flags: --test --persist-doctests /../../ -Z unstable-options
// failure-status: 101

#![crate_name = "foo"]

//! ```rust
//! use foo::dummy;
//! dummy();
//! ```
1 change: 1 addition & 0 deletions src/test/rustdoc-ui/issue-98690.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Couldn't create directory for doctest executables: Permission denied (os error 13)

0 comments on commit 29e0e14

Please sign in to comment.