Skip to content

Commit 470996a

Browse files
committed
Rollup merge of rust-lang#23813 - steveklabnik:gh19733, r=cmr
Fixes rust-lang#19733
2 parents 83d3503 + 6c0314a commit 470996a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/doc/reference.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,12 +1188,15 @@ the guarantee that these issues are never caused by safe code.
11881188

11891189
* Data races
11901190
* Dereferencing a null/dangling raw pointer
1191-
* Mutating an immutable value/reference without `UnsafeCell`
11921191
* Reads of [undef](http://llvm.org/docs/LangRef.html#undefined-values)
11931192
(uninitialized) memory
11941193
* Breaking the [pointer aliasing
11951194
rules](http://llvm.org/docs/LangRef.html#pointer-aliasing-rules)
11961195
with raw pointers (a subset of the rules used by C)
1196+
* `&mut` and `&` follow LLVM’s scoped [noalias] model, except if the `&T`
1197+
contains an `UnsafeCell<U>`. Unsafe code must not violate these aliasing
1198+
guarantees.
1199+
* Mutating an immutable value/reference without `UnsafeCell<U>`
11971200
* Invoking undefined behavior via compiler intrinsics:
11981201
* Indexing outside of the bounds of an object with `std::ptr::offset`
11991202
(`offset` intrinsic), with
@@ -1210,6 +1213,8 @@ the guarantee that these issues are never caused by safe code.
12101213
code. Rust's failure system is not compatible with exception handling in
12111214
other languages. Unwinding must be caught and handled at FFI boundaries.
12121215

1216+
[noalias]: http://llvm.org/docs/LangRef.html#noalias
1217+
12131218
##### Behaviour not considered unsafe
12141219

12151220
This is a list of behaviour not considered *unsafe* in Rust terms, but that may

0 commit comments

Comments
 (0)