diff options
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r-- | src/codegen/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 898df167..6fd7e7d3 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -2573,7 +2573,11 @@ impl CodeGenerator for Enum { if variation.is_rust() { attrs.push(attributes::repr(repr_name)); } else if variation.is_bitfield() { - attrs.push(attributes::repr("C")); + if ctx.options().rust_features.repr_transparent { + attrs.push(attributes::repr("transparent")); + } else { + attrs.push(attributes::repr("C")); + } } if let Some(comment) = item.comment(ctx) { |