External Publication
Visit Post

Change error message of a failing `assert_eq!`

Rust Internals [Unofficial] April 10, 2026
Source

CodesInChaos:

It's not clear if XXX/YYY in your post is supposed to be the value of the argument or its name. But since you invoked it without specifying a name, I assumed that it's supposed to be the debug representation of the value.

What are XXX supposed to be?

They are indeed the debug representation of the arguments. Those already get printed today. The macro already requires the types of the arguments to implement Debug. The only thing that's new in their proposal is the part before, the "assert some_object.array[i] == Some("foo") failed" part.

Please check your assumptions before making claims.

Discussion in the ATmosphere

Loading comments...