EDIT: SOLVED! by @cole-miller. Here is the working code for the example: Correct use of Rem<Output=T>
I have been unable to use % (Rem) operator with == operator in a generic context. The error I receive seems to not make sense. Here is an example of using code that only uses == in a generic context:
and here is several variations of code that does not work:
It seems like just having: Rem<u8> + From<u8> + PartialEq
should allow the modulo and == comparison to work (by converting u8's to T's with from) and it shouldn't be a problem.
What am I missing?
The error I'm getting is complaining about the == operator as follows:
error[E0369]: binary operation `==` cannot be applied to type `<T as Rem>::Output`
--> src/main.rs:4:24
|
4 | if el % T::from(8) == T::from(0) {
| --------------- ^^ ---------- T
| |
| <T as Rem>::Output