deduce_resets: show more debugging info on assertion failure

This commit is contained in:
Jacob Lifshay 2024-12-01 20:08:43 -08:00
parent 3abba7f9eb
commit 965fe53077
Signed by: programmerjake
SSH key fingerprint: SHA256:HnFTLGpSm4Q4Fj502oCFisjZSoakwEuTsJJMSke63RQ

View file

@ -770,7 +770,10 @@ impl<'a, P: Pass> PassArgs<'a, P> {
fallback_error_source_location: Option<SourceLocation>,
) -> Result<(), DeduceResetsError> {
assert_eq!(a.layout, b.layout);
assert_eq!(a.ty, b.ty);
assert!(
a.ty.can_connect(b.ty),
"can't connect types! a:\n{a:?}\nb:\n{b:?}"
);
for (a_node_index, b_node_index) in a.node_indexes.into_iter().zip(b.node_indexes) {
self.state.reset_graph.union(
a_node_index,