Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/types/pointer.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ These also point to memory owned by some other value.
A mutable reference type is written `&mut type` or `&'a mut type`.
A mutable reference (that hasn't been borrowed) is the only way to access the value it points to, so is not `Copy`.

While a mutable reference is alive, it is the only reference pointing to the referent; no other reference,
mutable or shared, point to the same value. For the safe subset of the language, this constraint is
verified by the compiler. For code that use `unsafe`, it's up to the programmer to follow this constraint to avoid
[undefined behavior] for correctness.

## Raw pointers (`*const` and `*mut`)

> **<sup>Syntax</sup>**\
Expand Down Expand Up @@ -58,3 +63,4 @@ The standard library contains additional 'smart pointer' types beyond references
[`unsafe` operation]: ../unsafety.md
[dynamically sized types]: ../dynamically-sized-types.md
[temporary value]: ../expressions.md#temporaries
[undefined behavior]: ../behavior-considered-undefined.md