about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-02-25 23:31:35 -0800
committerbors <bors@rust-lang.org>2014-02-25 23:31:35 -0800
commit6c41f993d390a0a8d9f42cfca4f365b6f93d0c26 (patch)
tree7c6f2b7f77df5c55da8c0a32884f0a7685053b3b /src
parenteb86913dcf72dcb628d9b5250aabd2da0ca7df49 (diff)
parent82747ed93e5af967b691653a56849da2c209d85d (diff)
downloadrust-6c41f993d390a0a8d9f42cfca4f365b6f93d0c26.tar.gz
rust-6c41f993d390a0a8d9f42cfca4f365b6f93d0c26.zip
auto merge of #12547 : jagtalon/rust/jag/rust/tutorial-freezing, r=pnkfelix
- "Lending an immutable pointer" might be confusing. It was not discussed why borrowed pointers are immutable in the first place.
- Make it clear that the borrowed pointers are immutable even if the variable was declared with `mut`.
- Make it clear that we cannot even assign anything to the variable while its value is being borrowed.

tutorial: change "--" to an em-dash.

tutorial: change instances of "--" to em-dash.
Diffstat (limited to 'src')
-rw-r--r--src/doc/tutorial.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md
index 41bf15c0c14..3c071e9f999 100644
--- a/src/doc/tutorial.md
+++ b/src/doc/tutorial.md
@@ -1468,14 +1468,14 @@ For a more in-depth explanation of references and lifetimes, read the
 
 ## Freezing
 
-Lending an immutable pointer to an object freezes it and prevents mutation.
+Lending an &-pointer to an object freezes it and prevents mutation—even if the object was declared as `mut`.
 `Freeze` objects have freezing enforced statically at compile-time. An example
 of a non-`Freeze` type is [`RefCell<T>`][refcell].
 
 ~~~~
 let mut x = 5;
 {
-    let y = &x; // `x` is now frozen, it cannot be modified
+    let y = &x; // `x` is now frozen. It cannot be modified or re-assigned.
 }
 // `x` is now unfrozen again
 # x = 3;
@@ -2021,8 +2021,8 @@ C++ templates.
 
 ## Traits
 
-Within a generic function -- that is, a function parameterized by a
-type parameter, say, `T` -- the operations we can do on arguments of
+Within a generic function—that is, a function parameterized by a
+type parameter, say, `T`—the operations we can do on arguments of
 type `T` are quite limited.  After all, since we don't know what type
 `T` will be instantiated with, we can't safely modify or query values
 of type `T`.  This is where _traits_ come into play. Traits are Rust's