-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Mismatch between documentation and implementation of debug_assert_eq macro #30600
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
What does "equality in both directions" even mean? |
It used to check if |
The commit that introduced this mismatch was debug_assert_eq internally uses assert_eq, and when assert_eq was changed to check equality in one direction only (in above commit), the documentation for debug_assert_eq wasn't adjusted. |
As the macro was stabilized when it checked equality in one direction only. I guess it makes most sense to adjust the documentation, and not the code? |
Yep, this is a docs issue. |
Also, make its panic description identical in wording to assert_eq. Fixes rust-lang#30600
Also, make its panic description identical in wording to assert_eq. Fixes rust-lang#30600
The documentation for the
debug_assert_eq
macro claims:But if you read the implementation of
debug_assert_eq
, you see that it tests equality in one direction only. Also see the example: http://is.gd/YGKAOjThe text was updated successfully, but these errors were encountered: