Old implementations can be overwritten before solving

This commit is contained in:
Ayaz Hafiz 2022-10-10 15:08:51 -05:00
parent 7298705db7
commit bd5f5ed735
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 12 additions and 2 deletions

View file

@ -504,8 +504,12 @@ impl IAbilitiesStore<Pending> {
let old_declared_impl = self.declared_implementations.insert(impl_key, member_impl);
debug_assert!(
old_declared_impl.is_none(),
"Replacing existing declared impl!"
old_declared_impl.is_none() ||
// Can happen between we import declared implementations during canonicalization, but
// implementation information only after solving
old_declared_impl.unwrap() == member_impl,
"Replacing existing declared impl: {:?}",
(impl_key, old_declared_impl)
);
}