Parses a tagged register reference from a raw `u64`, returning the absolute register index and the type of the value it holds. Panics if the type tag is invalid.
(self)
| 224 | /// |
| 225 | /// Panics if the type tag is invalid. |
| 226 | pub(crate) fn parse(self) -> (usize, ExprType) { |
| 227 | let vtype: ExprType = { |
| 228 | #[allow(unsafe_code)] |
| 229 | unsafe { |
| 230 | let v = unchecked_u64_as_u8(self.0 >> 32); |
| 231 | assert!(v <= ExprType::Text as u8); |
| 232 | std::mem::transmute(v) |
| 233 | } |
| 234 | }; |
| 235 | |
| 236 | let index = unchecked_u32_as_usize((self.0 & 0xffffffff) as u32); |
| 237 | |
| 238 | (index, vtype) |
| 239 | } |
| 240 | |
| 241 | /// Returns the raw `u64` encoding. |
| 242 | pub(crate) fn as_u64(&self) -> u64 { |
no outgoing calls
no test coverage detected