nicer errors

This commit is contained in:
Ralf Jung 2022-08-26 17:43:04 -04:00
parent 82802337a8
commit 235036fcb3
2 changed files with 4 additions and 4 deletions

View File

@ -534,14 +534,14 @@ fn main() {
let filename = param.to_string();
if std::path::Path::new(&filename).exists() {
if let Some(other_filename) = miri_config.external_so_file {
panic!(
"-Zmiri-extern-so-file external SO file is already set to {}",
show_error!(
"-Zmiri-extern-so-file is already set to {}",
other_filename.display()
);
}
miri_config.external_so_file = Some(filename.into());
} else {
panic!("-Zmiri-extern-so-file path {} does not exist", filename);
show_error!("-Zmiri-extern-so-file `{}` does not exist", filename);
}
} else {
// Forward to rustc.

View File

@ -431,7 +431,7 @@ impl<'mir, 'tcx> Evaluator<'mir, 'tcx> {
(
unsafe {
libloading::Library::new(lib_file_path)
.expect("Failed to read specified shared object file")
.expect("failed to read specified extern shared object file")
},
lib_file_path.clone(),
)