We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf636c2 commit 5ce1b33Copy full SHA for 5ce1b33
src/doc/trpl/pointers.md
@@ -687,7 +687,9 @@ than the hundred `int`s that make up the `BigStruct`.
687
688
This is an antipattern in Rust. Instead, write this:
689
690
-```{rust}
+```rust
691
+#![feature(box_syntax)]
692
+
693
struct BigStruct {
694
one: i32,
695
two: i32,
@@ -706,10 +708,13 @@ fn main() {
706
708
one_hundred: 100,
707
709
});
710
- let y = Box::new(foo(x));
711
+ let y = box foo(x);
712
}
713
```
714
715
+Note that this uses the `box_syntax` feature gate, so this syntax may change in
716
+the future.
717
718
This gives you flexibility without sacrificing performance.
719
720
You may think that this gives us terrible performance: return a value and then
0 commit comments