New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second-generation binary operator traits with specialization #2578

wants to merge 5 commits into
base: master


None yet
3 participants

mzabaluev commented Oct 25, 2018

Provide new traits for overloading binary operators, such as PartialEq2, PartialOrd2, Add2, AddAssign2, etc., with default blanket implementations abstracted over Borrow for built-in and standard library types. This will drastically reduce the number of explicit impl items necessary to cover compatible type pairs. When resolving the implementation for an operator, the compiler will
consider the new traits along with the old school non-specializable traits.

Rendered view

mzabaluev added some commits Oct 24, 2018

Expanded on the default impl rule
Added more explanation, details, and motivational impetus for the
default blanket implementation rule.

This comment has been minimized.


mzabaluev commented Oct 26, 2018

@withoutboats The compiler will need to be changed to consider the new traits, with a kink in the algorithm. Are you sure T-lang does not apply?

mzabaluev added some commits Oct 26, 2018

Linkified the mention of specialization
Link to the specialization RFC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment