Skip to content

Commit 1b3a53c

Browse files
committed
make some debug assertion failures more informative
1 parent 3eb246c commit 1b3a53c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cargo/util/rustc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ impl Rustc {
8585
let commit_hash = extract("commit-hash: ").ok().map(|hash| {
8686
debug_assert!(
8787
hash.chars().all(|ch| ch.is_ascii_hexdigit()),
88-
"commit hash must be a hex string"
88+
"commit hash must be a hex string, got: {hash:?}"
8989
);
9090
debug_assert!(
9191
hash.len() == 40 || hash.len() == 64,
92-
"hex string must be generated from sha1 or sha256"
92+
"hex string must be generated from sha1 or sha256 (i.e., it must be 40 or 64 characters long)\ngot: {hash:?}"
9393
);
9494
hash.to_string()
9595
});

0 commit comments

Comments
 (0)