Skip to content

Commit bc68a88

Browse files
committed
manual: improve description of unsafe functions.
1 parent 9e6df28 commit bc68a88

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/rust.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -943,14 +943,15 @@ of that type.
943943
#### Unsafe functions
944944

945945
Unsafe functions are those containing unsafe operations that are not contained in an [`unsafe` block](#unsafe-blocks).
946+
Such a function must be prefixed with the keyword `unsafe`.
946947

947948
Unsafe operations are those that potentially violate the memory-safety guarantees of Rust's static semantics.
948949
Specifically, the following operations are considered unsafe:
949950

950-
- Dereferencing a [raw pointer](#pointer-types)
951-
- Casting a [raw pointer](#pointer-types) to a safe pointer type
952-
- Breaking the [purity-checking rules](#pure-functions)
953-
- Calling an unsafe function
951+
- Dereferencing a [raw pointer](#pointer-types).
952+
- Casting a [raw pointer](#pointer-types) to a safe pointer type.
953+
- Breaking the [purity-checking rules](#pure-functions) in a `pure` function.
954+
- Calling an unsafe function.
954955

955956
##### Unsafe blocks
956957

0 commit comments

Comments
 (0)