about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-05-16 10:15:33 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-06-11 09:51:37 -0700
commit54c2a1e1ce7f32576f0692a1de3fe2763d13bac9 (patch)
tree62c34c3c945986ccb3e409df57ed0579a2ddcf9a /src/doc
parent53ad426e92f8099a701f3f54c02dc8f069f5939a (diff)
downloadrust-54c2a1e1ce7f32576f0692a1de3fe2763d13bac9.tar.gz
rust-54c2a1e1ce7f32576f0692a1de3fe2763d13bac9.zip
rustc: Move the AST from @T to Gc<T>
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/tutorial.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md
index 3b4164ffbc6..802f7cd40bf 100644
--- a/src/doc/tutorial.md
+++ b/src/doc/tutorial.md
@@ -1710,14 +1710,14 @@ having ownership of the box. It allows the creation of cycles, and the individua
 not have a destructor.
 
 ~~~
-use std::gc::Gc;
+use std::gc::GC;
 
 // A fixed-size array allocated in a garbage-collected box
-let x = Gc::new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+let x = box(GC) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
 let y = x; // does not perform a move, unlike with `Rc`
 let z = x;
 
-assert!(*z.borrow() == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+assert!(*z == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
 ~~~
 
 With shared ownership, mutability cannot be inherited so the boxes are always immutable. However,