about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2021-02-04 11:01:52 +0100
committerMichael Woerister <michaelwoerister@posteo>2021-02-04 11:01:52 +0100
commit97380e3b06555c0dd3a8fd1e3d2ca7c4bfeeb21f (patch)
tree1bb0005964dd88e187ec2764a9c9b28a5d957025 /compiler
parentd4d8bdf52bd2a3ae0f581e6f7c347f6222a0f14c (diff)
downloadrust-97380e3b06555c0dd3a8fd1e3d2ca7c4bfeeb21f.tar.gz
rust-97380e3b06555c0dd3a8fd1e3d2ca7c4bfeeb21f.zip
Add more explanation to local DefPathHash collision case.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir/src/definitions.rs9
1 files changed, 8 insertions, 1 deletions
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