diff --git a/compiler/generator/rust/rust_code_container.cpp b/compiler/generator/rust/rust_code_container.cpp index 9e1b201d29..4b2d89ddbb 100644 --- a/compiler/generator/rust/rust_code_container.cpp +++ b/compiler/generator/rust/rust_code_container.cpp @@ -176,6 +176,8 @@ void RustCodeContainer::produceClass() tab(n, *fOut); *fOut << "#[cfg_attr(feature = \"default-boxed\", derive(default_boxed::DefaultBoxed))]"; tab(n, *fOut); + *fOut << "#[repr(C)]"; + tab(n, *fOut); *fOut << "pub struct " << fKlassName << " {"; tab(n + 1, *fOut);