Skip to content

Commit b3c133d

Browse files
committed
types: Don't avoid the destructor check when looking at unions.
This is kind of unfortunate, but we weren't taking into account explicit destructors.
1 parent eab08be commit b3c133d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/types.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,13 +681,14 @@ impl CompInfo {
681681
if self.no_copy {
682682
return false;
683683
}
684+
685+
if self.has_destructor() {
686+
return false;
687+
}
688+
684689
match self.kind {
685690
CompKind::Union => true,
686691
CompKind::Struct => {
687-
if self.has_destructor() {
688-
return false;
689-
}
690-
691692
// With template args, use a safe subset of the types,
692693
// since copyability depends on the types itself.
693694
self.ref_template.as_ref().map_or(true, |t| t.can_derive_copy()) &&

0 commit comments

Comments
 (0)