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

@ -354,7 +354,7 @@ impl ParsedIns {
/// Returns an iterator over the arguments of the instruction,
/// stopping at the first [Argument::None].
#[inline]
pub fn args_iter(&self) -> impl Iterator<Item=&Argument> {
pub fn args_iter(&self) -> impl Iterator<Item = &Argument> {
self.args.iter().take_while(|x| !matches!(x, Argument::None))
}
}

View File

@ -1052,7 +1052,7 @@ impl Opcode {
let pattern = OPCODE_PATTERNS[i as usize];
if (code & pattern.0) == pattern.1 {
// 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

View File

@ -338,7 +338,7 @@ pub fn gen_disasm(isa: &Isa, max_args: usize) -> Result<TokenStream> {
let pattern = OPCODE_PATTERNS[i as usize];
if (code & pattern.0) == pattern.1 {
#[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