Skip to content

Commit 97380e3

Browse files
Add more explanation to local DefPathHash collision case.
1 parent d4d8bdf commit 97380e3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/rustc_hir/src/definitions.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ impl DefPathTable {
5252

5353
// Continuing with colliding DefPathHashes can lead to correctness
5454
// issues. We must abort compilation.
55-
panic!("Found DefPathHash collsion between {:?} and {:?}", def_path1, def_path2);
55+
//
56+
// The likelyhood of such a collision is very small, so actually
57+
// running into one could be indicative of a poor hash function
58+
// being used.
59+
//
60+
// See the documentation for DefPathHash for more information.
61+
panic!("found DefPathHash collsion between {:?} and {:?}. \
62+
Compilation cannot continue.", def_path1, def_path2);
5663
}
5764

5865
// Assert that all DefPathHashes correctly contain the local crate's

0 commit comments

Comments
 (0)