mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Merge #10799
10799: fix: Fix proc macro ABI version checks r=lnicola a=lnicola If I'm reading this right, we used to pick `Abi1_55` for `1.54` and `Abi_1_58` for `1.57`. CC `@alexjg` (just in case I'm misinterpreting the code), CC #10772. bors r+ Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
commit
ea01a3aa9f
1 changed files with 20 additions and 16 deletions
|
@ -69,22 +69,26 @@ impl Abi {
|
||||||
symbol_name: String,
|
symbol_name: String,
|
||||||
info: RustCInfo,
|
info: RustCInfo,
|
||||||
) -> Result<Abi, LoadProcMacroDylibError> {
|
) -> Result<Abi, LoadProcMacroDylibError> {
|
||||||
if info.version.0 != 1 {
|
// FIXME: this should use exclusive ranges when they're stable
|
||||||
Err(LoadProcMacroDylibError::UnsupportedABI)
|
// https://github.com/rust-lang/rust/issues/37854
|
||||||
} else if info.version.1 < 47 {
|
match (info.version.0, info.version.1) {
|
||||||
Err(LoadProcMacroDylibError::UnsupportedABI)
|
(1, 47..=54) => {
|
||||||
} else if info.version.1 < 54 {
|
let inner = unsafe { Abi_1_47::from_lib(lib, symbol_name) }?;
|
||||||
let inner = unsafe { Abi_1_47::from_lib(lib, symbol_name) }?;
|
Ok(Abi::Abi1_47(inner))
|
||||||
Ok(Abi::Abi1_47(inner))
|
}
|
||||||
} else if info.version.1 < 56 {
|
(1, 55..=55) => {
|
||||||
let inner = unsafe { Abi_1_55::from_lib(lib, symbol_name) }?;
|
let inner = unsafe { Abi_1_55::from_lib(lib, symbol_name) }?;
|
||||||
Ok(Abi::Abi1_55(inner))
|
Ok(Abi::Abi1_55(inner))
|
||||||
} else if info.version.1 < 57 {
|
}
|
||||||
let inner = unsafe { Abi_1_56::from_lib(lib, symbol_name) }?;
|
(1, 56..=57) => {
|
||||||
Ok(Abi::Abi1_56(inner))
|
let inner = unsafe { Abi_1_56::from_lib(lib, symbol_name) }?;
|
||||||
} else {
|
Ok(Abi::Abi1_56(inner))
|
||||||
let inner = unsafe { Abi_1_58::from_lib(lib, symbol_name) }?;
|
}
|
||||||
Ok(Abi::Abi1_58(inner))
|
(1, 58..) => {
|
||||||
|
let inner = unsafe { Abi_1_58::from_lib(lib, symbol_name) }?;
|
||||||
|
Ok(Abi::Abi1_58(inner))
|
||||||
|
}
|
||||||
|
_ => Err(LoadProcMacroDylibError::UnsupportedABI),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue