Skip to content
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

Remove old operator overloading #4205

Closed
brson opened this issue Dec 16, 2012 · 5 comments
Closed

Remove old operator overloading #4205

brson opened this issue Dec 16, 2012 · 5 comments
Labels
A-type-system Area: Type system E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.
Milestone

Comments

@brson
Copy link
Contributor

brson commented Dec 16, 2012

Old-style, non-trait-based, operator overloading is still in the language.

@sanxiyn
Copy link
Member

sanxiyn commented Jan 31, 2013

#3143 is closed, but this issue is still open?

@brson
Copy link
Contributor Author

brson commented Jan 31, 2013

@sanxiyn I can't explain why I closed that one, nor am I sure of the state of old-style operator overloading. Last I knew it still worked but recent changes may have removed it in passing.

Old overloading worked by the name of the method alone, so add was +. The telltale sign of old operator overloading is when an impl of Num is enough to overload the arithmetic operators (by virtue of its add, etc. methods). + is supposed to be implemented with the Add trait, not Num.

@bstrie
Copy link
Contributor

bstrie commented Feb 15, 2013

Is this done?

@brson
Copy link
Contributor Author

brson commented Feb 26, 2013

@bstrie Not yet.

@pcwalton
Copy link
Contributor

Fixed

flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 21, 2022
Add lint for confusing use of `^` instead of `.pow`

fixes rust-lang#4205
Adds a lint named [`confusing_xor_and_pow`], it warns the user when `a ^ b` is used as the `.pow()` function, it doesn't warn for Hex, Binary... etc.

---

changelog: New lint: [`confusing_xor_and_pow`]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.
Projects
None yet
Development

No branches or pull requests

4 participants