-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add internal lint against Ty == Ty
#107393
The head ref may contain hidden characters: "Are\u2000the\u2000types\u2000equal\u097D\u2000Who\u2000even\u2000knows\u2000at\u2000this\u2000point"
Add internal lint against Ty == Ty
#107393
Conversation
r? @eholk (rustbot has picked a reviewer for you, use r? to override) |
Can you open an issue to enable it by default in 6 weeks? |
How many times does this fire on the repo? How many of those are things that should be fixed? |
This comment has been minimized.
This comment has been minimized.
fc1687d
to
0edbc4b
Compare
This comment has been minimized.
This comment has been minimized.
I've done a little more thinking about this and looked at some code and I think there are now a few things to do:
|
3af7802
to
db25c54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me, one nit
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #109001) made this pull request unmergeable. Please resolve the merge conflicts. |
Hello @Nilstrieb! I noticed that this PR has some merge conflicts, what's the status of it? |
basically the steps described above. I need to fix the (absolutely trivial, thanks git) conflicts and then merge it and go through the plan later. I'll try doing that later this week if I don't forget about it. |
db25c54
to
ce705db
Compare
This comment has been minimized.
This comment has been minimized.
768a7ca
to
bff2feb
Compare
great question, i had to figure that out myself |
r? compiler-errors you've already reviewed it and we were talking about it |
This comment has been minimized.
This comment has been minimized.
bff2feb
to
71a030e
Compare
This comment has been minimized.
This comment has been minimized.
71a030e
to
bd04c1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me if ci is happy
This comment has been minimized.
This comment has been minimized.
bd04c1e
to
0fd08a6
Compare
This comment has been minimized.
This comment has been minimized.
@rustbot author |
☔ The latest upstream changes (presumably #113734) made this pull request unmergeable. Please resolve the merge conflicts. |
0fd08a6
to
307610c
Compare
This comment has been minimized.
This comment has been minimized.
This operation does not do what people usually want. Also check against other comparison operators since they are just as sketchy. Allow the `ty_eq_operator` lint for now until the next bootstrap bump
307610c
to
7ca7722
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
☔ The latest upstream changes (presumably #116196) made this pull request unmergeable. Please resolve the merge conflicts. |
Ping from triage |
yes, i need to get back to this, there are some weird interactions with rustdoc that i haven't looked at |
Ping from triage: I'm closing this due to inactivity, Please reopen when you are ready to continue with this. @rustbot label: +S-inactive |
==
is often the first and most obvious operation people use to check whether types are equal, but it's usually not what they want, as it doesn't consider inference variables, bound vars and normalization.We still need
Ty: Eq
for various things, for example for the query system.There are still places where using it is "good enough" if the types are known to not have the caveats above (it should NOT be used in diagnostics though as the caveats will lead to worse diagnostics).
The lint points people to a yet-to-be-written section of the rustc dev guide about how to compare types properly.
I have not yet activated it by default because all the
cfg_attr(bootstrap, allow)
would be really annoying, so we should only activate and fix it after the bootstrap compiler is bumped to contain the lint.