// check-pass #![feature(generic_const_exprs)] #![allow(incomplete_features)] #![deny(const_evaluatable_unchecked)] pub struct If; pub trait True {} impl True for If {} pub struct FixedI8 { pub bits: i8, } impl PartialEq> for FixedI8 where If<{ FRAC_RHS <= 8 }>: True, { fn eq(&self, _rhs: &FixedI8) -> bool { unimplemented!() } } impl PartialEq for FixedI8 { fn eq(&self, rhs: &i8) -> bool { let rhs_as_fixed = FixedI8::<0> { bits: *rhs }; PartialEq::eq(self, &rhs_as_fixed) } } fn main() {}