Skip to content

Commit 8ae98b2

Browse files
committed
Remove Eq & ParitalEq for RealInstruction
1 parent a405cca commit 8ae98b2

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

crates/compiler-core/src/bytecode/instruction.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{
1515
/// A Single bytecode instruction.
1616
/// Instructions are ordered to match CPython 3.13 opcode numbers exactly.
1717
/// HAVE_ARGUMENT = 44: opcodes 0-43 have no argument, 44+ have arguments.
18-
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
18+
#[derive(Clone, Copy, Debug)]
1919
#[repr(u8)]
2020
pub enum RealInstruction {
2121
// ==================== No-argument instructions (opcode < 44) ====================
@@ -784,7 +784,7 @@ impl InstructionMetadata for RealInstruction {
784784
}
785785
}
786786

787-
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
787+
#[derive(Clone, Copy, Debug)]
788788
#[repr(u16)]
789789
pub enum PseudoInstruction {
790790
Jump {
@@ -816,6 +816,8 @@ pub enum PseudoInstruction {
816816
StoreFastMaybeNull = 267, // Placeholder
817817
}
818818

819+
const _: () = assert!(mem::size_of::<PseudoInstruction>() == 2);
820+
819821
impl From<PseudoInstruction> for u16 {
820822
#[inline]
821823
fn from(ins: PseudoInstruction) -> Self {
@@ -884,9 +886,8 @@ impl InstructionMetadata for PseudoInstruction {
884886
}
885887
}
886888

887-
const _: () = assert!(mem::size_of::<PseudoInstruction>() == 2);
888-
889-
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
889+
#[derive(Clone, Copy, Debug)]
890+
#[repr(u16)]
890891
pub enum Instruction {
891892
Real(RealInstruction),
892893
Pseudo(PseudoInstruction),

crates/compiler-core/src/bytecode/oparg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl OpArgState {
8080
#[inline(always)]
8181
pub fn get(&mut self, ins: CodeUnit) -> (RealInstruction, OpArg) {
8282
let arg = self.extend(ins.arg);
83-
if ins.op != RealInstruction::ExtendedArg {
83+
if !matches!(ins.op, RealInstruction::ExtendedArg) {
8484
self.reset();
8585
}
8686
(ins.op, arg)

0 commit comments

Comments
 (0)