Skip to content

Commit 52ff5d1

Browse files
committed
Always emit repr(C) for unsafe unions
1 parent 59c8278 commit 52ff5d1

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

cpp2rust/converter/converter.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,7 @@ void Converter::EmitRustStructOrUnion(clang::RecordDecl *decl) {
822822
}
823823

824824
void Converter::EmitRustUnion(clang::RecordDecl *decl) {
825-
if (EmitsReprCForRecords()) {
826-
StrCat("#[repr(C)]");
827-
}
825+
StrCat("#[repr(C)]");
828826
auto attrs = GetStructAttributes(decl);
829827
Mapper::SetDerives(ctx_.getCanonicalTagType(decl),
830828
std::vector<std::string>(attrs.begin(), attrs.end()));

0 commit comments

Comments
 (0)