From 1b3a53ca388569c2f2aad79c24afcdd296a88142 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 12 Nov 2023 18:35:16 +0100 Subject: [PATCH] make some debug assertion failures more informative --- src/cargo/util/rustc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cargo/util/rustc.rs b/src/cargo/util/rustc.rs index f51580f29b4..c313ec795bf 100644 --- a/src/cargo/util/rustc.rs +++ b/src/cargo/util/rustc.rs @@ -85,11 +85,11 @@ impl Rustc { let commit_hash = extract("commit-hash: ").ok().map(|hash| { debug_assert!( hash.chars().all(|ch| ch.is_ascii_hexdigit()), - "commit hash must be a hex string" + "commit hash must be a hex string, got: {hash:?}" ); debug_assert!( hash.len() == 40 || hash.len() == 64, - "hex string must be generated from sha1 or sha256" + "hex string must be generated from sha1 or sha256 (i.e., it must be 40 or 64 characters long)\ngot: {hash:?}" ); hash.to_string() });