diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ir/analysis/derive_hash.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ir/analysis/derive_hash.rs b/src/ir/analysis/derive_hash.rs index 569c7246..d2eac677 100644 --- a/src/ir/analysis/derive_hash.rs +++ b/src/ir/analysis/derive_hash.rs @@ -187,7 +187,10 @@ impl<'ctx> MonotoneFramework for CannotDeriveHash<'ctx> { return self.insert(id); } - if len <= RUST_DERIVE_IN_ARRAY_LIMIT { + if len == 0 { + trace!(" cannot derive `Hash` for incomplete arrays"); + self.insert(id) + } else if len <= RUST_DERIVE_IN_ARRAY_LIMIT { trace!(" array is small enough to derive Hash"); ConstrainResult::Same } else { |