aboutsummaryrefslogtreecommitdiff
path: root/src/long_mode/mod.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-03-21 14:30:17 -0700
committeriximeow <me@iximeow.net>2021-03-21 14:30:17 -0700
commitfcd9fc30d2fa41b2267a6539e5806735bae8931d (patch)
tree02eb659edc4eb03f266c17880d5e21f662856099 /src/long_mode/mod.rs
parent0591d78e5b1c1c232fd6c6e4c159fd428f19ade9 (diff)
make Opcode, Operand, and DecodeError non_exhaustive
in the future these can and will change (new operands, new instructions) and i would prefer they not be major breaking changes. applications can ignore them and probably do undesired variants anyway. if you want to write a 1120-variant match, are you me? why would you do this
Diffstat (limited to 'src/long_mode/mod.rs')
-rw-r--r--src/long_mode/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs
index 5ca6542..2935385 100644
--- a/src/long_mode/mod.rs
+++ b/src/long_mode/mod.rs
@@ -429,6 +429,7 @@ enum SizeCode {
}
#[derive(Clone, Debug, PartialEq)]
+#[non_exhaustive]
pub enum Operand {
ImmediateI8(i8),
ImmediateU8(u8),
@@ -883,6 +884,7 @@ const XSAVE: [Opcode; 10] = [
#[allow(non_camel_case_types)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+#[non_exhaustive]
pub enum Opcode {
Invalid,
ADD,
@@ -1997,6 +1999,7 @@ impl yaxpeax_arch::Instruction for Instruction {
}
#[derive(Debug, PartialEq)]
+#[non_exhaustive]
pub enum DecodeError {
ExhaustedInput,
InvalidOpcode,