mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-04 19:12:50 +00:00
Auto merge of #14153 - CraftSpider:v7-metadata, r=CraftSpider
Add v7 metadata support to rust-analyzer Paired to https://github.com/rust-lang/rust/pull/101550
This commit is contained in:
commit
89b9940491
@ -120,17 +120,20 @@ pub fn read_version(dylib_path: &AbsPath) -> io::Result<String> {
|
|||||||
let version = u32::from_be_bytes([dot_rustc[4], dot_rustc[5], dot_rustc[6], dot_rustc[7]]);
|
let version = u32::from_be_bytes([dot_rustc[4], dot_rustc[5], dot_rustc[6], dot_rustc[7]]);
|
||||||
// Last supported version is:
|
// Last supported version is:
|
||||||
// https://github.com/rust-lang/rust/commit/0696e79f2740ad89309269b460579e548a5cd632
|
// https://github.com/rust-lang/rust/commit/0696e79f2740ad89309269b460579e548a5cd632
|
||||||
match version {
|
let snappy_portion = match version {
|
||||||
5 | 6 => {}
|
5 | 6 => &dot_rustc[8..],
|
||||||
|
7 => {
|
||||||
|
let len_bytes = &dot_rustc[8..12];
|
||||||
|
let data_len = u32::from_be_bytes(len_bytes.try_into().unwrap()) as usize;
|
||||||
|
&dot_rustc[12..data_len + 12]
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
return Err(io::Error::new(
|
return Err(io::Error::new(
|
||||||
io::ErrorKind::InvalidData,
|
io::ErrorKind::InvalidData,
|
||||||
format!("unsupported metadata version {version}"),
|
format!("unsupported metadata version {version}"),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
let snappy_portion = &dot_rustc[8..];
|
|
||||||
|
|
||||||
let mut snappy_decoder = SnapDecoder::new(snappy_portion);
|
let mut snappy_decoder = SnapDecoder::new(snappy_portion);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user