diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-12-31 16:10:54 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-01-03 14:02:01 -0800 |
| commit | 9b35ae75d2e275e6dbc4b93061f7b16c4efb5b19 (patch) | |
| tree | 3ab0d12480c1a4acb5c42b42113fddd6ea55094b | |
| parent | c3694d732ef9ed641671fbf116d183e78dc4e90a (diff) | |
| download | rust-9b35ae75d2e275e6dbc4b93061f7b16c4efb5b19.tar.gz rust-9b35ae75d2e275e6dbc4b93061f7b16c4efb5b19.zip | |
doc: Remove all mentions of `@mut` from the documentation.
| -rw-r--r-- | doc/tutorial.md | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/doc/tutorial.md b/doc/tutorial.md index a19d8c3e820..ce21edf1b40 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1431,8 +1431,8 @@ For a more in-depth explanation of borrowed pointers, read the ## Freezing Lending an immutable pointer to an object freezes it and prevents mutation. -`Freeze` objects have freezing enforced statically at compile-time. Examples -of non-`Freeze` types are `@mut` and [`RefCell<T>`][refcell]. +`Freeze` objects have freezing enforced statically at compile-time. An example +of a non-`Freeze` type is [`RefCell<T>`][refcell]. ~~~~ let mut x = 5; @@ -1443,20 +1443,6 @@ let mut x = 5; # x = 3; ~~~~ -Mutable managed boxes handle freezing dynamically when any of their contents -are borrowed, and the task will fail if an attempt to modify them is made while -they are frozen: - -~~~~ -let x = @mut 5; -let y = x; -{ - let z = &*y; // the managed box is now frozen - // modifying it through x or y will cause a task failure -} -// the box is now unfrozen again -~~~~ - [refcell]: http://static.rust-lang.org/doc/master/std/cell/struct.RefCell.html # Dereferencing pointers @@ -1477,7 +1463,7 @@ assignments. Such an assignment modifies the value that the pointer points to. ~~~ -let managed = @mut 10; +let managed = @10; let mut owned = ~20; let mut value = 30; @@ -2113,8 +2099,7 @@ unless they contain managed boxes, managed closures, or borrowed pointers. * `Freeze` - Constant (immutable) types. These are types that do not contain anything intrinsically mutable. -Intrinsically mutable values include `@mut` -and `Cell` in the standard library. +Intrinsically mutable values include `Cell` in the standard library. * `'static` - Non-borrowed types. These are types that do not contain any data whose lifetime is bound to |
