Resolve clippy::missing_transmute_annotations

This commit is contained in:
Luke Street 2024-04-30 19:46:54 -06:00
parent d63c94c3e2
commit 6cbd7d888c
3 changed files with 3 additions and 3 deletions

View File

@ -1052,7 +1052,7 @@ impl Opcode {
let pattern = OPCODE_PATTERNS[i as usize]; let pattern = OPCODE_PATTERNS[i as usize];
if (code & pattern.0) == pattern.1 { if (code & pattern.0) == pattern.1 {
// Safety: The enum is repr(u8) and marked non_exhaustive // Safety: The enum is repr(u8) and marked non_exhaustive
return unsafe { core::mem::transmute(i) }; return unsafe { core::mem::transmute::<u8, Opcode>(i) };
} }
} }
Self::Illegal Self::Illegal

View File

@ -338,7 +338,7 @@ pub fn gen_disasm(isa: &Isa, max_args: usize) -> Result<TokenStream> {
let pattern = OPCODE_PATTERNS[i as usize]; let pattern = OPCODE_PATTERNS[i as usize];
if (code & pattern.0) == pattern.1 { if (code & pattern.0) == pattern.1 {
#[comment = " Safety: The enum is repr(u8) and marked non_exhaustive"] #[comment = " Safety: The enum is repr(u8) and marked non_exhaustive"]
return unsafe { core::mem::transmute(i) }; return unsafe { core::mem::transmute::<u8, Opcode>(i) };
} }
} }
Self::Illegal Self::Illegal