about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2015-02-13 08:55:11 -0500
committerSteve Klabnik <steve@steveklabnik.com>2015-02-13 12:35:56 -0500
commit5ce1b33502b6c90868874dbc649ee3e336b1928e (patch)
treefc3fd8760c14c2091863f3b813d01f788b09f944
parentcf636c233dfeef5abf0de8fb35e23c0a161810d2 (diff)
downloadrust-5ce1b33502b6c90868874dbc649ee3e336b1928e.tar.gz
rust-5ce1b33502b6c90868874dbc649ee3e336b1928e.zip
Reintroduce box syntax where needed
Otherwise, this line is a lie.
-rw-r--r--src/doc/trpl/pointers.md9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/doc/trpl/pointers.md b/src/doc/trpl/pointers.md
index 9c649cd2273..332f299a67f 100644
--- a/src/doc/trpl/pointers.md
+++ b/src/doc/trpl/pointers.md
@@ -687,7 +687,9 @@ than the hundred `int`s that make up the `BigStruct`.
 
 This is an antipattern in Rust. Instead, write this:
 
-```{rust}
+```rust
+#![feature(box_syntax)]
+
 struct BigStruct {
     one: i32,
     two: i32,
@@ -706,10 +708,13 @@ fn main() {
         one_hundred: 100,
     });
 
-    let y = Box::new(foo(x));
+    let y = box foo(x);
 }
 ```
 
+Note that this uses the `box_syntax` feature gate, so this syntax may change in
+the future.
+
 This gives you flexibility without sacrificing performance.
 
 You may think that this gives us terrible performance: return a value and then