Skip to content

Commit 6b197e9

Browse files
committed
Revise unsafety chapter for unsafe extern
In light of `unsafe extern`, we need to note that only unsafe extern statics need `unsafe { .. }` and to clarify that not all foreign functions are necessarily unsafe to call. Co-authored-by: ehuss
1 parent dd47cde commit 6b197e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/unsafety.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ r[safety.unsafe-deref]
1313
- Dereferencing a [raw pointer].
1414

1515
r[safety.unsafe-static]
16-
- Reading or writing a [mutable] or [external] static variable.
16+
- Reading or writing a [mutable] or unsafe [external] static variable.
1717

1818
r[safety.unsafe-union-access]
1919
- Accessing a field of a [`union`], other than to assign to it.
2020

2121
r[safety.unsafe-call]
22-
- Calling an unsafe function (including an intrinsic or foreign function).
22+
- Calling an unsafe function.
2323

2424
r[safety.unsafe-target-feature-call]
2525
- Calling a safe function marked with a [`target_feature`][attributes.codegen.target_feature] from a function that does not have a `target_feature` attribute enabling the same features (see [attributes.codegen.target_feature.safety-restrictions]).

0 commit comments

Comments
 (0)