mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 21:43:37 +00:00
internal: Add version info to unsupported proc macro abi error
This commit is contained in:
parent
add85397ae
commit
6b4b7d81e4
3 changed files with 5 additions and 5 deletions
|
@ -117,7 +117,7 @@ impl Abi {
|
|||
let inner = unsafe { Abi_1_63::from_lib(lib, symbol_name) }?;
|
||||
Ok(Abi::Abi1_63(inner))
|
||||
}
|
||||
_ => Err(LoadProcMacroDylibError::UnsupportedABI),
|
||||
_ => Err(LoadProcMacroDylibError::UnsupportedABI(info.version_string.clone())),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -80,14 +80,14 @@ fn load_library(file: &Path) -> Result<Library, libloading::Error> {
|
|||
pub enum LoadProcMacroDylibError {
|
||||
Io(io::Error),
|
||||
LibLoading(libloading::Error),
|
||||
UnsupportedABI,
|
||||
UnsupportedABI(String),
|
||||
}
|
||||
|
||||
impl fmt::Display for LoadProcMacroDylibError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::Io(e) => e.fmt(f),
|
||||
Self::UnsupportedABI => write!(f, "unsupported ABI version"),
|
||||
Self::UnsupportedABI(v) => write!(f, "unsupported ABI `{v}`"),
|
||||
Self::LibLoading(e) => e.fmt(f),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,12 +113,12 @@ impl ProcMacroSrv {
|
|||
|
||||
fn expander(&mut self, path: &Path) -> Result<&dylib::Expander, String> {
|
||||
let time = fs::metadata(path).and_then(|it| it.modified()).map_err(|err| {
|
||||
format!("Failed to get file metadata for {}: {:?}", path.display(), err)
|
||||
format!("Failed to get file metadata for {}: {}", path.display(), err)
|
||||
})?;
|
||||
|
||||
Ok(match self.expanders.entry((path.to_path_buf(), time)) {
|
||||
Entry::Vacant(v) => v.insert(dylib::Expander::new(path).map_err(|err| {
|
||||
format!("Cannot create expander for {}: {:?}", path.display(), err)
|
||||
format!("Cannot create expander for {}: {}", path.display(), err)
|
||||
})?),
|
||||
Entry::Occupied(e) => e.into_mut(),
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue