mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Assert that sysroot ABI version matches exactly
Otherwise, fall back to the multi ABI scheme, except in testing, where it becomes a hard error. This should make it possible to use a rustup-provided rust-analyzer with proc macro dylibs compiled by older rustcs, and it'll also catch changes to the format of `rustc --version` or the `.rustc` section that would make them impossible to compare for equality.
This commit is contained in:
parent
480f555334
commit
fdddd83224
5 changed files with 62 additions and 9 deletions
|
@ -102,7 +102,7 @@ fn read_section<'a>(dylib_binary: &'a [u8], section_name: &str) -> io::Result<&'
|
|||
/// * [some more bytes that we don't really care but about still there] :-)
|
||||
/// Check this issue for more about the bytes layout:
|
||||
/// <https://github.com/rust-lang/rust-analyzer/issues/6174>
|
||||
fn read_version(dylib_path: &AbsPath) -> io::Result<String> {
|
||||
pub fn read_version(dylib_path: &AbsPath) -> io::Result<String> {
|
||||
let dylib_file = File::open(dylib_path)?;
|
||||
let dylib_mmaped = unsafe { Mmap::map(&dylib_file) }?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue