diff --git a/src/simulator/register.rs b/src/simulator/register.rs index 339c0e5..bbad262 100644 --- a/src/simulator/register.rs +++ b/src/simulator/register.rs @@ -6,6 +6,14 @@ use crate::simulator::machine::{NUM_FP_REGS, NUM_INT_REGS}; use std::ops::{Add, Sub}; +/// Forcing the Register struct's generic type into having the following Traits +/// +/// - Add +/// - Sub +/// - PartialEq +/// - Copy +/// +/// Generally speaking, only numbers have the combinaison of these traits. pub trait RegisterNum: Add + Sub + PartialEq + Copy {} impl RegisterNum for i64 {}