-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #79100 - a1phyr:better_assert_eq, r=m-ou-se
Improve assert_eq! and assert_ne! This PR improves `assert_eq!` and `assert_ne!` by moving the panicking code in an external function. It does not change the fast path, but the move of the formatting in the cold path (the panic) may have a positive effect on in instruction cache use and with inlining. Moreover, the use of trait objects instead of generic may improve compile times for `assert_eq!`-heavy code. Godbolt link: ~~https://rust.godbolt.org/z/TYa9MT~~ \ Updated: https://rust.godbolt.org/z/bzE84x
- Loading branch information
Showing
15 changed files
with
292 additions
and
831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.