You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our current trait matching rules for operator overloading are somewhat ad-hoc. I've got a branch which implements a more straightforward set of rules, which I think is what we want for 1.0 going forward. Part of completing this bug will be updating the docs.
The rules I've in mind can be summarized as:
Given an expression l op r where op is a binary operator and l : L and r : R:
We search for a trait impl Op<R,T> for L. Note that there is no attempt to autoderef l and so forth.
At runtime we'll pass in &l and &r to the trait method (as is reflected in the &self type etc).