Skip to content

Commit 1e919c9

Browse files
committed
rollup merge of rust-lang#18408 : thestinger/unsafe
2 parents 5ee8569 + 8a71925 commit 1e919c9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/doc/reference.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ exposing an API making it possible for it to occur in safe code.
11531153

11541154
* Data races
11551155
* Dereferencing a null/dangling raw pointer
1156-
* Mutating an immutable value/reference
1156+
* Mutating an immutable value/reference without `UnsafeCell`
11571157
* Reads of [undef](http://llvm.org/docs/LangRef.html#undefined-values)
11581158
(uninitialized) memory
11591159
* Breaking the [pointer aliasing
@@ -1166,11 +1166,14 @@ exposing an API making it possible for it to occur in safe code.
11661166
* Using `std::ptr::copy_nonoverlapping_memory` (`memcpy32`/`memcpy64`
11671167
instrinsics) on overlapping buffers
11681168
* Invalid values in primitive types, even in private fields/locals:
1169-
* Dangling/null pointers in non-raw pointers, or slices
1169+
* Dangling/null references or boxes
11701170
* A value other than `false` (0) or `true` (1) in a `bool`
11711171
* A discriminant in an `enum` not included in the type definition
11721172
* A value in a `char` which is a surrogate or above `char::MAX`
11731173
* non-UTF-8 byte sequences in a `str`
1174+
* Unwinding into Rust from foreign code or unwinding from Rust into foreign
1175+
code. Rust's failure system is not compatible with exception handling in
1176+
other languages. Unwinding must be caught and handled at FFI boundaries.
11741177

11751178
##### Behaviour not considered unsafe
11761179

0 commit comments

Comments
 (0)