External Publication
Visit Post

Change error message of a failing `assert_eq!`

Rust Internals [Unofficial] April 1, 2026
Source

Note that there would be no need to name both arguments, so all of assert_eq!(expected = foo, actual = bar), assert_eq!(foo, actual = bar), assert_eq!(expected = foo, bar), assert_eq!(actual = bar, foo), assert_eq!(bar, expected = foo), assert_eq!(foo, bar) could be accepted, which would provide 4 ways of opting into the change of wording without too much additional verbosity.

Discussion in the ATmosphere

Loading comments...