mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Rollup merge of #98708 - pinkforest:rustdoc-fix-98690, r=GuillaumeGomez
rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests Closes #98690 for rustdoc panic I changed this to do eprintln and orderly panic instead of unwrap doing unhandled panic ~/gg/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc --test -Z unstable-options --persist-doctests /tmp/foobar main.rs Couldn't create directory for doctest executables: Permission denied (os error 13)
This commit is contained in:
commit
00d68a7890
@ -1003,8 +1003,10 @@ impl Tester for Collector {
|
|||||||
let outdir = if let Some(mut path) = rustdoc_options.persist_doctests.clone() {
|
let outdir = if let Some(mut path) = rustdoc_options.persist_doctests.clone() {
|
||||||
path.push(&test_id);
|
path.push(&test_id);
|
||||||
|
|
||||||
std::fs::create_dir_all(&path)
|
if let Err(err) = std::fs::create_dir_all(&path) {
|
||||||
.expect("Couldn't create directory for doctest executables");
|
eprintln!("Couldn't create directory for doctest executables: {}", err);
|
||||||
|
panic::resume_unwind(box ());
|
||||||
|
}
|
||||||
|
|
||||||
DirState::Perm(path)
|
DirState::Perm(path)
|
||||||
} else {
|
} else {
|
||||||
|
10
src/test/rustdoc-ui/issue-98690.rs
Normal file
10
src/test/rustdoc-ui/issue-98690.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// compile-flags: --test --persist-doctests /../../ -Z unstable-options
|
||||||
|
// failure-status: 101
|
||||||
|
// only-linux
|
||||||
|
|
||||||
|
#![crate_name = "foo"]
|
||||||
|
|
||||||
|
//! ```rust
|
||||||
|
//! use foo::dummy;
|
||||||
|
//! dummy();
|
||||||
|
//! ```
|
1
src/test/rustdoc-ui/issue-98690.stderr
Normal file
1
src/test/rustdoc-ui/issue-98690.stderr
Normal file
@ -0,0 +1 @@
|
|||||||
|
Couldn't create directory for doctest executables: Permission denied (os error 13)
|
Loading…
Reference in New Issue
Block a user