diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-06-02 13:39:50 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-06-10 11:04:12 +0200 |
| commit | ab277a439b75af677877494a13db65b9e4d125ec (patch) | |
| tree | 7234e013ac4d52f8251e23ff527bced07be54ccf | |
| parent | 8b36867093fb774bcbd9f787cbc470a5f44c1310 (diff) | |
| download | rust-ab277a439b75af677877494a13db65b9e4d125ec.tar.gz rust-ab277a439b75af677877494a13db65b9e4d125ec.zip | |
Prevent panic when sysroot cannot be computed
| -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 5bce5d6ba5d..3df06fc45c0 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, |
