-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Typechecker should stop this #802
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
Comments
That seems legitimate. We do autoderef on binary operators. |
I guess maybe the real solution is that we need proper abstract types. Still, I question whether autoderefing tags makes sense. Tags seem very different from pointers. |
Autoderef on newtype-tags is important in at least one case: Using such a type to break a recursive type. You'll wrap your record in a newtype in such a case, and it is hugely convenient to be able to do Maybe we should just stop autodereferencing for binary ops? That's not a feature I would expect. |
I think removing autoderef for binary ops is a good idea. As Sully was pointing out earlier today, it limits our ability to do type-inference for binary operations. |
As written, this works as intended. I'd personally be in favor of removing autoderef too, but IMHO it should be a separate bug. |
I personally think that for true pointer types Rust should auto-deference more. In 99.99% of the cases I do not care if something is a pointer or an actual value. I would like to see the case for single constructor enums separated out and handled separately instead. |
add setfsgid/setfsuid on Linux
This program should not compile, but it does.
The text was updated successfully, but these errors were encountered: