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