Skip to content

Commit e1fbe80

Browse files
ahomescukkysen
authored andcommitted
c2rust-refactor: Handle different number of fields between structures/unions in compatible_types
1 parent a2f854e commit e1fbe80

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

c2rust-refactor/src/context.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,11 @@ impl<'a, 'tcx, 'b> TypeCompare<'a, 'tcx, 'b> {
11581158
self.structural_eq_tys(ty1, ty2)
11591159
}
11601160
}
1161-
_ => {
1161+
_ => 'match_fields: {
1162+
if variant1.fields().len() != variant2.fields().len() {
1163+
break 'match_fields false;
1164+
}
1165+
11621166
let mut fields = variant1.fields().iter().zip(variant2.fields().iter());
11631167
fields.all(|(field1, field2)| {
11641168
// TODO: either Visibility or VisibilityKind should implement

0 commit comments

Comments
 (0)