diff options
| author | ljedrz <ljedrz@gmail.com> | 2018-07-23 14:47:13 +0200 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2018-07-23 14:47:13 +0200 |
| commit | fe588d894fa392fdf787c18a959b342d38d0c71c (patch) | |
| tree | be50072cdfa499237686ad83b94c725d2d96500e /src/librustc_codegen_llvm/back | |
| parent | 210d61f05c8c2f9e58f167eb28ab9d8bbef4968b (diff) | |
| download | rust-fe588d894fa392fdf787c18a959b342d38d0c71c.tar.gz rust-fe588d894fa392fdf787c18a959b342d38d0c71c.zip | |
Replace a few expect+format combos with unwrap_or_else+panic
Diffstat (limited to 'src/librustc_codegen_llvm/back')
| -rw-r--r-- | src/librustc_codegen_llvm/back/rpath.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/back/rpath.rs b/src/librustc_codegen_llvm/back/rpath.rs index f46205cb590..e73073cfad0 100644 --- a/src/librustc_codegen_llvm/back/rpath.rs +++ b/src/librustc_codegen_llvm/back/rpath.rs @@ -114,8 +114,8 @@ fn get_rpath_relative_to_output(config: &mut RPathConfig, lib: &Path) -> String let mut output = cwd.join(&config.out_filename); output.pop(); let output = fs::canonicalize(&output).unwrap_or(output); - let relative = path_relative_from(&lib, &output) - .expect(&format!("couldn't create relative path from {:?} to {:?}", output, lib)); + let relative = path_relative_from(&lib, &output).unwrap_or_else(|| + panic!("couldn't create relative path from {:?} to {:?}", output, lib)); // FIXME (#9639): This needs to handle non-utf8 paths format!("{}/{}", prefix, relative.to_str().expect("non-utf8 component in path")) |
