How can I use generic Add trait in generic Mul trait?

I am trying to implement some operations on a "curve" with coordinates in a "field", where the field will have different implementations (of varying efficiency). The points on the curve can be added, I express that using core::ops::Add, parametrized by the field implementation.
My issue is a type issue, which arises when I try to define "multiples of points" as core::ops::Mul: multiply a point by a scalar (the multiplier), while using the addition. is a stripped down version (with rubbish implementation).

What am I doing wrong here? I'm quite confused by the fact that the compiler looks for Add on Curve<Curve<_>> and so on. I'd assume the trait bound in line 53 is what's needed, but since it makes no difference, I commented it out.

I guess this is similar to Strange rust compiler recursion?

Likely I will replace the swappable-via-traits implementations with feature flags, but this is a bit sad.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.