about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-01-25 16:23:43 -0800
committerBrian Anderson <banderson@mozilla.com>2012-01-25 16:24:06 -0800
commit2999479a2dcb10019558d64c2045fdee31841d31 (patch)
tree331200932427d412f7d406d992212f91cea564dc /src/test
parent08c6cb5f708efa7484ca27d6b14b86d6ae58b692 (diff)
rustc: Allow attributes on enum variants. Closes #1663
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/variant-attributes.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/run-pass/variant-attributes.rs b/src/test/run-pass/variant-attributes.rs
new file mode 100644
index 00000000000..45d79c83532
--- /dev/null
+++ b/src/test/run-pass/variant-attributes.rs
@@ -0,0 +1,29 @@
+// pp-exact - Make sure we actually print the attributes
+
+enum crew_of_enterprise_d {
+
+    #[captain]
+    jean_luc_picard,
+
+    #[commander]
+    william_t_riker,
+
+    #[chief_medical_officer]
+    beverly_crusher,
+
+    #[ships_councellor]
+    deanna_troi,
+
+    #[lieutenant_commander]
+    data,
+
+    #[chief_of_security]
+    worf,
+
+    #[chief_engineer]
+    geordi_la_forge,
+}
+
+fn boldly_go(_crew_member: crew_of_enterprise_d, _where: str) { }
+
+fn main() { boldly_go(worf, "where no one has gone before"); }