diff options
| author | bors <bors@rust-lang.org> | 2019-06-30 01:44:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-06-30 01:44:44 +0000 |
| commit | fd7f48b3eff67726d848c059574b6aa86675110b (patch) | |
| tree | 95a0fe6cd1f273bb7ac3ea4876f3300d52abe6d6 | |
| parent | 9a90d03ad171856dc016c2dcc19292ec49a8a26f (diff) | |
| parent | ab277a439b75af677877494a13db65b9e4d125ec (diff) | |
| download | rust-fd7f48b3eff67726d848c059574b6aa86675110b.tar.gz rust-fd7f48b3eff67726d848c059574b6aa86675110b.zip | |
Auto merge of #61459 - GuillaumeGomez:fix-rustdoc-sysroot-panic, r=ollie27,bjorn3,QuietMisdreavus
Prevent panic when sysroot cannot be computed Fixes #61377. cc @rotty @rust-lang/rustdoc r? @Manishearth
| -rw-r--r-- | src/librustdoc/test.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index ddce5cab1eb..7b90561bdad 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -44,8 +44,7 @@ pub fn run(options: Options) -> i32 { let input = config::Input::File(options.input.clone()); let sessopts = config::Options { - maybe_sysroot: options.maybe_sysroot.clone().or_else( - || Some(env::current_exe().unwrap().parent().unwrap().parent().unwrap().to_path_buf())), + maybe_sysroot: options.maybe_sysroot.clone(), search_paths: options.libs.clone(), crate_types: vec![config::CrateType::Dylib], cg: options.codegen_options.clone(), @@ -225,8 +224,7 @@ fn run_test( let outputs = OutputTypes::new(&[(OutputType::Exe, None)]); let sessopts = config::Options { - maybe_sysroot: maybe_sysroot.or_else( - || Some(env::current_exe().unwrap().parent().unwrap().parent().unwrap().to_path_buf())), + maybe_sysroot, search_paths: libs, crate_types: vec![config::CrateType::Executable], output_types: outputs, |
