#![allow(dead_code, deprecated, unused_variables, unused_mut)] use std::ops::Shr; #[derive(PartialEq, Debug)] struct Scalar(usize); impl Shr for Scalar { type Output = Self; fn shr(self, Self(rhs): Self) -> Self::Output { let Self(lhs) = self; Self(lhs >> rhs) } } fn main() { assert_eq!(Scalar(16) >> Scalar(2), Scalar(4)); }