diff options
author | iximeow <me@iximeow.net> | 2024-06-23 22:22:31 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2024-06-23 22:22:31 -0700 |
commit | 25b9a530b3b19b9dcb27b9596df51f43bb272bd8 (patch) | |
tree | 4cae0f1ab2a71996fc5bd2ccce4ddfd1c0b4ce9b /src/long_mode/mod.rs | |
parent | 09dcfca94240b6c18fbaa1186781dac0d436e500 (diff) |
fix several sources of dead code warnings in various crate configs
Diffstat (limited to 'src/long_mode/mod.rs')
-rw-r--r-- | src/long_mode/mod.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index 5a3dc51..5ed35e3 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -807,7 +807,8 @@ impl Operand { /// provided for parity with [`Instruction::visit_operand`]. this has little utility other than /// to reuse an `OperandVisitor` on an `Operand` directly. - pub fn visit<T: OperandVisitor>(&self, visitor: &mut T) -> Result<T::Ok, T::Error> { + #[allow(dead_code)] // in some configurations this is unused, but it is internal-only for now, so it would warn. + fn visit<T: OperandVisitor>(&self, visitor: &mut T) -> Result<T::Ok, T::Error> { match self { Operand::Nothing => { visitor.visit_other() @@ -4395,6 +4396,7 @@ impl Opcode { } #[inline(always)] + #[allow(dead_code)] // in some configurations this is unused, but it is internal-only for now, so it would warn. fn can_rep(&self) -> bool { (*self as u32) & 0x2000 != 0 } @@ -4420,7 +4422,8 @@ impl Instruction { Operand::from_spec(self, self.operands[i as usize]) } - /// TODO: make public, document, etc... + // TODO: make public when this seems stable and worthwhile. currently only used for display + // and Displaysink etc.. /// /// `visit_operand` allows code using operands to better specialize and inline with the logic /// that would construct an [`Operand`] variant, without having to necessarily construct an @@ -4430,8 +4433,8 @@ impl Instruction { /// dispatching on tags may be a substantial factor of overall runtime. `visit_operand` can /// reduce total overhead in such cases. #[cfg_attr(feature="profiling", inline(never))] + #[allow(dead_code)] // in some configurations this is unused, but it is internal-only for now, so it would warn. fn visit_operand<T: OperandVisitor>(&self, i: u8, visitor: &mut T) -> Result<T::Ok, T::Error> { - assert!(i < 4); let spec = self.operands[i as usize]; match spec { OperandSpec::Nothing => { |