Update Freeze
information
This commit is contained in:
parent
fab5624eb6
commit
c8f47db8f5
1 changed files with 4 additions and 1 deletions
|
@ -1431,7 +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.
|
||||
`Owned` objects have freezing enforced statically at compile-time.
|
||||
`Freeze` objects have freezing enforced statically at compile-time. Examples
|
||||
of non-`Freeze` types are `@mut` and [`RefCell<T>`][refcell].
|
||||
|
||||
~~~~
|
||||
let mut x = 5;
|
||||
|
@ -1456,6 +1457,8 @@ let y = x;
|
|||
// the box is now unfrozen again
|
||||
~~~~
|
||||
|
||||
[refcell]: http://static.rust-lang.org/doc/master/std/cell/struct.RefCell.html
|
||||
|
||||
# Dereferencing pointers
|
||||
|
||||
Rust uses the unary star operator (`*`) to access the contents of a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue