mirror of
https://git.proxmox.com/git/proxmox
synced 2025-04-28 11:44:39 +00:00
shared-memory: specify generic types for transmute
this annotates a `transmute` call with proper types to avoid possible undefined behaviour, as suggested by clippy [1]. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
This commit is contained in:
parent
ab2d5c9777
commit
dcc6eb9918
@ -75,7 +75,7 @@ fn mmap_file<T: Init>(file: &mut File, initialize: bool) -> Result<Mmap<T>, Erro
|
||||
Err(err) => bail!("detected wrong types in mmaped files: {}", err),
|
||||
}
|
||||
|
||||
Ok(unsafe { std::mem::transmute(mmap) })
|
||||
Ok(unsafe { std::mem::transmute::<Mmap<MaybeUninit<T>>, Mmap<T>>(mmap) })
|
||||
}
|
||||
|
||||
impl<T: Sized + Init> SharedMemory<T> {
|
||||
|
Loading…
Reference in New Issue
Block a user