Skip to content

Allow floating point (in-)equality comparisons to literals in assert_eq! and assert_ne! macros - #17571

Open
George-Ogden wants to merge 7 commits into
rust-lang:masterfrom
George-Ogden:assert-eq-const-cmp
Open

Allow floating point (in-)equality comparisons to literals in assert_eq! and assert_ne! macros#17571
George-Ogden wants to merge 7 commits into
rust-lang:masterfrom
George-Ogden:assert-eq-const-cmp

Conversation

@George-Ogden

@George-Ogden George-Ogden commented Aug 15, 2026

Copy link
Copy Markdown

changelog: [float_cmp_const] Check for floating-point (in-)equality comparisons to constants in assert_eq! and assert_ne! macros.

Fixes #17570

@rustbot

rustbot commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome!

You should hear from one of our reviewers after this PR gets at least 2 reviews from the community.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 15, 2026
@George-Ogden

Copy link
Copy Markdown
Author

r? @llogiq

@rustbot rustbot removed the S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. label Aug 15, 2026
Comment thread .editorconfig

@llogiq llogiq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks good modulo the editorconfig change. So please revert that and then we can merge.

View changes since this review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression for float_cmp in assert_eq!(x, 1.0)

3 participants