From 97380e3b06555c0dd3a8fd1e3d2ca7c4bfeeb21f Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Thu, 4 Feb 2021 11:01:52 +0100 Subject: [PATCH] Add more explanation to local DefPathHash collision case. --- compiler/rustc_hir/src/definitions.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_hir/src/definitions.rs b/compiler/rustc_hir/src/definitions.rs index 7ab55db509b..9210c744c5f 100644 --- a/compiler/rustc_hir/src/definitions.rs +++ b/compiler/rustc_hir/src/definitions.rs @@ -52,7 +52,14 @@ impl DefPathTable { // Continuing with colliding DefPathHashes can lead to correctness // issues. We must abort compilation. - panic!("Found DefPathHash collsion between {:?} and {:?}", def_path1, def_path2); + // + // The likelyhood of such a collision is very small, so actually + // running into one could be indicative of a poor hash function + // being used. + // + // See the documentation for DefPathHash for more information. + panic!("found DefPathHash collsion between {:?} and {:?}. \ + Compilation cannot continue.", def_path1, def_path2); } // Assert that all DefPathHashes correctly contain the local crate's