Auto merge of #16469 - Young-Flash:ci_typos, r=lnicola

internal: add typos check CI (part 2)

follow up https://github.com/rust-lang/rust-analyzer/pull/16448
This commit is contained in:
bors 2024-02-02 12:02:48 +00:00
commit 8f6a72871e
22 changed files with 450 additions and 208 deletions

View file

@ -106,9 +106,9 @@ fn read_section<'a>(dylib_binary: &'a [u8], section_name: &str) -> io::Result<&'
/// <https://github.com/rust-lang/rust-analyzer/issues/6174>
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) }?;
let dylib_mmapped = unsafe { Mmap::map(&dylib_file) }?;
let dot_rustc = read_section(&dylib_mmaped, ".rustc")?;
let dot_rustc = read_section(&dylib_mmapped, ".rustc")?;
// check if magic is valid
if &dot_rustc[0..4] != b"rust" {