mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
include source error for LoadLibraryExW
This commit is contained in:
parent
033aa092ab
commit
24adb1f68c
@ -27,6 +27,7 @@ use rustc_span::{Span, DUMMY_SP};
|
||||
use rustc_target::spec::{PanicStrategy, TargetTriple};
|
||||
|
||||
use proc_macro::bridge::client::ProcMacro;
|
||||
use std::error::Error;
|
||||
use std::ops::Fn;
|
||||
use std::path::Path;
|
||||
use std::time::Duration;
|
||||
@ -1094,5 +1095,12 @@ fn load_dylib(path: &Path, max_attempts: usize) -> Result<libloading::Library, S
|
||||
}
|
||||
|
||||
debug!("Failed to load proc-macro `{}` even after {} attempts.", path.display(), max_attempts);
|
||||
Err(format!("{} (retried {} times)", last_error.unwrap(), max_attempts))
|
||||
|
||||
let last_error = last_error.unwrap();
|
||||
let message = if let Some(src) = last_error.source() {
|
||||
format!("{last_error} ({src}) (retried {max_attempts} times)")
|
||||
} else {
|
||||
format!("{last_error} (retried {max_attempts} times)")
|
||||
};
|
||||
Err(message)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user