MCPcopy Create free account
hub / github.com/SoftbearStudios/bitcode / as_primitive

Method as_primitive

src/int.rs:15–21  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

13impl<T: Int, P: NoUninit> Encoder<P> for IntEncoder<T> {
14 #[inline(always)]
15 fn as_primitive(&mut self) -> Option<&mut VecImpl<P>> {
16 use std::mem::*;
17 assert_eq!(align_of::<T>(), align_of::<P>());
18 assert_eq!(size_of::<T>(), size_of::<P>());
19 // Safety: size/align are equal, T: Int implies Pod, and caller isn't reading P which may be NonZero.
20 unsafe { Some(transmute(&mut self.0)) }
21 }
22
23 #[inline(always)]
24 fn encode(&mut self, p: &P) {

Callers

nothing calls this directly

Calls 2

castMethod · 0.80
mut_sliceMethod · 0.80

Tested by

no test coverage detected