Resolve clippy::missing_transmute_annotations
This commit is contained in:
parent
d63c94c3e2
commit
6cbd7d888c
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue