summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/codegen/mod.rs6
-rw-r--r--src/features.rs6
2 files changed, 11 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) {
diff --git a/src/features.rs b/src/features.rs
index 6f10f11b..1f700039 100644
--- a/src/features.rs
+++ b/src/features.rs
@@ -100,6 +100,8 @@ macro_rules! rust_target_base {
=> Stable_1_26 => 1.26;
/// Rust stable 1.27
=> Stable_1_27 => 1.27;
+ /// Rust stable 1.28
+ => Stable_1_28 => 1.28;
/// Nightly rust
=> Nightly => nightly;
);
@@ -184,6 +186,10 @@ rust_feature_def!(
/// `must_use` attribute on functions ([PR](https://github.com/rust-lang/rust/pull/48925))
=> must_use_function;
}
+ Stable_1_28 {
+ /// repr(transparent) ([PR](https://github.com/rust-lang/rust/pull/51562))
+ => repr_transparent;
+ }
Nightly {
/// `thiscall` calling convention ([Tracking issue](https://github.com/rust-lang/rust/issues/42202))
=> thiscall_abi;