1
Fork 0

deny(unsafe_op_in_unsafe_fn) in rustc_data_structures

This commit is contained in:
Maybe Waffle 2023-04-19 18:00:48 +00:00
parent d7f9e81650
commit f79df7d2a4
4 changed files with 106 additions and 98 deletions

View file

@ -13,7 +13,8 @@ pub struct Mmap(Vec<u8>);
impl Mmap {
#[inline]
pub unsafe fn map(file: File) -> io::Result<Self> {
memmap2::Mmap::map(&file).map(Mmap)
// Safety: this is in fact not safe.
unsafe { memmap2::Mmap::map(&file).map(Mmap) }
}
}