about summary refs log tree commit diff
path: root/src/doc/rust.md
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc/rust.md')
-rw-r--r--src/doc/rust.md3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/doc/rust.md b/src/doc/rust.md
index 06c9da2fe0e..619e24af360 100644
--- a/src/doc/rust.md
+++ b/src/doc/rust.md
@@ -1260,6 +1260,8 @@ a = Cat;
 Enumeration constructors can have either named or unnamed fields:
 
 ~~~~
+# #![feature(struct_variant)]
+# fn main() {
 enum Animal {
     Dog (String, f64),
     Cat { name: String, weight: f64 }
@@ -1267,6 +1269,7 @@ enum Animal {
 
 let mut a: Animal = Dog("Cocoa".to_string(), 37.2);
 a = Cat { name: "Spotty".to_string(), weight: 2.7 };
+# }
 ~~~~
 
 In this example, `Cat` is a _struct-like enum variant_,