From 6da09c3b437dad240218b91ea06c301982764152 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 9 Oct 2012 21:21:07 -0700 Subject: [PATCH] doc: Fix some inaccuracies in the tutorial. * Pointers can refer to stack objects as well as heap objects. * Non-managed types can be cyclic if an arena is used. --- doc/tutorial.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index d49fcf92cab..dc88b2a8911 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1054,7 +1054,7 @@ copied, not just a pointer. For small structs like `Point`, this is usually more efficient than allocating memory and going through a pointer. But for big structs, or those with mutable fields, it can be useful to have a single copy on -the heap, and refer to that through a pointer. +the stack or on the heap, and refer to that through a pointer. Rust supports several types of pointers. The safe pointer types are `@T` for managed boxes allocated on the local heap, `~T`, for @@ -1087,8 +1087,7 @@ let y = x; // Copy of a pointer to the same box ~~~~ Any type that contains managed boxes or other managed types is -considered _managed_. Managed types are the only types that can -construct cyclic data structures in Rust, such as doubly-linked lists. +considered _managed_. ~~~ // A linked list node