{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreigrhj7ki3pzcv4dc4kqrwzuasqedmw3k4hi6sieowqnhks4azzqea",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mifbbxh7wbv2"
},
"path": "/t/change-error-message-of-a-failing-assert-eq/24118#post_17",
"publishedAt": "2026-03-31T09:47:06.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"assert2"
],
"textContent": "You may be interested in the assert2 crate:\n\nFor the standard library, this could be solved by a debug hook like `std::fmt::set_debug_hook`, so we can have a separate crate `colored_debug_hook` that you install, and it intercepts output of any `Debug` call. We might do something more advanced, and the hook could be able to modify more granular parts of the debug output, like the `debug_struct` or `debug_tuple` methods etc.",
"title": "Change error message of a failing `assert_eq!`"
}