-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Lint unnamed address comparisons #5294
Conversation
☔ The latest upstream changes (presumably #5272) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #5380) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
This looks great! I'm unsure if "insignificant" is the best word to use here, though, thoughts on how to improve that?
Either way, please rebase and we can land this :)
The issues generally arise from incorrect expectation that those addresses are unique, so "non-unique" might be another option. |
non-unique works for me! "unstable" is another one but that might give the impression that they're unstable across compiles, which isn't the main problem here |
@bors r+ thanks! |
📌 Commit b77b219 has been approved by |
Lint unnamed address comparisons Functions and vtables have an insignificant address. Attempts to compare such addresses will lead to very surprising behaviour. For example: addresses of different functions could compare equal; two trait object pointers representing the same object and the same type could be unequal. Lint against unnamed address comparisons to avoid issues like those in rust-lang/rust#69757 and rust-lang/rust#54685. Changelog: New lints: [`fn_address_comparisons`] [#5294](#5294), [`vtable_address_comparisons`] [#5294](#5294)
💔 Test failed - checks-action_test |
@bors retry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Functions and vtables have an insignificant address. Attempts to compare such addresses will lead to very surprising behaviour. For example: addresses of different functions could compare equal; two trait object pointers representing the same object and the same type could be unequal.
Lint against unnamed address comparisons to avoid issues like those in rust-lang/rust#69757 and rust-lang/rust#54685.
changelog: New lints: [
fn_address_comparisons
] #5294, [vtable_address_comparisons
] #5294