about summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
diff options
context:
space:
mode:
authorRobin Kruppe <robin.kruppe@gmail.com>2018-01-03 17:43:30 +0100
committerRobin Kruppe <robin.kruppe@gmail.com>2018-01-16 08:58:32 +0100
commit2be697bc215f19b4bf17df6b9b56626ab7b1d994 (patch)
tree5eaf535d1e91da488908f4ac4a8ab6763e8535fe /src/libsyntax/feature_gate.rs
parent79a521bb9a8ace1a6663578a4c409906adde620d (diff)
downloadrust-2be697bc215f19b4bf17df6b9b56626ab7b1d994.tar.gz
rust-2be697bc215f19b4bf17df6b9b56626ab7b1d994.zip
Implement repr(transparent)
Diffstat (limited to 'src/libsyntax/feature_gate.rs')
-rw-r--r--src/libsyntax/feature_gate.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 196fadcc997..953b2deb877 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -452,6 +452,9 @@ declare_features! (
 
     // `extern` in paths
     (active, extern_in_paths, "1.23.0", Some(44660)),
+
+    // Allows `#[repr(transparent)]` attribute on newtype structs
+    (active, repr_transparent, "1.25.0", Some(43036)),
 );
 
 declare_features! (
@@ -1524,6 +1527,11 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
                                                "the struct `#[repr(align(u16))]` attribute \
                                                 is experimental");
                         }
+                        if item.check_name("transparent") {
+                            gate_feature_post!(&self, repr_transparent, attr.span,
+                                               "the `#[repr(transparent)]` attribute \
+                                               is experimental");
+                        }
                     }
                 }
             }