-
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
Add lint for float in array comparison #5345
Add lint for float in array comparison #5345
Conversation
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.
lgtm
Hi @flip1995, |
It's a GHA bug, that will hopefully be fixed today/soon. So don't worry about it |
I've made the changes requested in conversations, so this PR can be reviewed again. |
Thanks! Waiting for GHA to get fixed. |
@Toxyxer you have to run tests/ui/update-references.sh 'target/debug/test_build_base' 'float_cmp.rs' again |
Sorry, I forgot about the second change :> |
@bors r+ rollup |
📌 Commit 4348af2 has been approved by |
🌲 The tree is currently closed for pull requests below priority 2, this pull request will be tested once the tree is reopened |
…comparison, r=flip1995 Add lint for float in array comparison Fixes rust-lang#4277 changelog: - Added new handler for expression of index kind (e.g. `arr[i]`). It returns a constant when both array and index are constant, or when the array is constant and all values are equal. - Trigger float_cmp and float_cmp_const lint when comparing arrays. Allow for comparison when one of the arrays contains only zeros or infinities. - Added appropriate tests for such cases.
Rollup of 12 pull requests Successful merges: - #5345 (Add lint for float in array comparison) - #5406 (Fix update_lints) - #5409 (Downgrade let_unit_value to pedantic) - #5410 (Downgrade trivially_copy_pass_by_ref to pedantic) - #5412 (Downgrade inefficient_to_string to pedantic) - #5415 (Add new lint for `Result<T, E>.map_or(None, Some(T))`) - #5417 (Update doc links and mentioned names in docs) - #5419 (Downgrade unreadable_literal to pedantic) - #5420 (Downgrade new_ret_no_self to pedantic) - #5422 (CONTRIBUTING.md: fix broken triage link) - #5424 (Incorrect suspicious_op_assign_impl) - #5425 (Ehance opt_as_ref_deref lint.) Failed merges: - #5411 (Downgrade implicit_hasher to pedantic) - #5428 (Move cognitive_complexity to nursery) r? @ghost changelog: rollup
☔ The latest upstream changes (presumably #5429) made this pull request unmergeable. Please resolve the merge conflicts. |
Rollup of 11 pull requests Successful merges: - #5406 (Fix update_lints) - #5409 (Downgrade let_unit_value to pedantic) - #5410 (Downgrade trivially_copy_pass_by_ref to pedantic) - #5412 (Downgrade inefficient_to_string to pedantic) - #5415 (Add new lint for `Result<T, E>.map_or(None, Some(T))`) - #5417 (Update doc links and mentioned names in docs) - #5419 (Downgrade unreadable_literal to pedantic) - #5420 (Downgrade new_ret_no_self to pedantic) - #5422 (CONTRIBUTING.md: fix broken triage link) - #5424 (Incorrect suspicious_op_assign_impl) - #5425 (Ehance opt_as_ref_deref lint.) Failed merges: - #5345 (Add lint for float in array comparison) - #5411 (Downgrade implicit_hasher to pedantic) - #5428 (Move cognitive_complexity to nursery) r? @ghost changelog: rollup
@Toxyxer a rebase is required after the rollup #5438 |
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
@bors retry |
Ah.. that should have been |
📌 Commit 4449cc7 has been approved by |
… r=flip1995 Add lint for float in array comparison Fixes #4277 changelog: - Added new handler for expression of index kind (e.g. `arr[i]`). It returns a constant when both array and index are constant, or when the array is constant and all values are equal. - Trigger float_cmp and float_cmp_const lint when comparing arrays. Allow for comparison when one of the arrays contains only zeros or infinities. - Added appropriate tests for such cases.
💔 Test failed - checks-action_remark_test |
Hey @flip1995, |
This was probably just a random failure, let's try again @bors retry |
… r=flip1995 Add lint for float in array comparison Fixes #4277 changelog: - Added new handler for expression of index kind (e.g. `arr[i]`). It returns a constant when both array and index are constant, or when the array is constant and all values are equal. - Trigger float_cmp and float_cmp_const lint when comparing arrays. Allow for comparison when one of the arrays contains only zeros or infinities. - Added appropriate tests for such cases.
Hmm, bors should have merged this by now.. Let's give this another try 🤷 @bors retry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fixes #4277
changelog:
arr[i]
). It returns a constant when both array and index are constant, or when the array is constant and all values are equal.