Skip to content

Commit 8b4a45c

Browse files
committed
Reward the unsafe block to be more general
The `unsafe` block enables several abilities beyond just calling unsafe functions and dereferencing pointers. Link to the actual list of things you can do.
1 parent ec933d3 commit 8b4a45c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/unsafe-keyword.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ r[unsafe.block]
2727
## Unsafe blocks (`unsafe {}`)
2828

2929
r[unsafe.block.intro]
30-
A block of code can be prefixed with the `unsafe` keyword, to permit calling `unsafe` functions or dereferencing raw pointers.
30+
A block of code can be prefixed with the `unsafe` keyword to permit using the unsafe actions as defined in the [Unsafety] chapter, such as calling other unsafe functions or dereferencing raw pointers.
3131

3232
r[unsafe.block.fn-body]
3333
By default, the body of an unsafe function is also considered to be an unsafe block;
@@ -48,6 +48,8 @@ For example, a doubly-linked list is not a tree structure and can only be repres
4848
By using `unsafe` blocks to represent the reverse links as raw pointers, it can be implemented without reference counting.
4949
(See ["Learn Rust With Entirely Too Many Linked Lists"](https://rust-unofficial.github.io/too-many-lists/) for a more in-depth exploration of this particular example.)
5050

51+
[Unsafety]: unsafety.md
52+
5153
r[unsafe.trait]
5254
## Unsafe traits (`unsafe trait`)
5355

0 commit comments

Comments
 (0)