Skip to content

Commit 6e17582

Browse files
committed
update immutability rule
1 parent 8043278 commit 6e17582

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/behavior-considered-undefined.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ code.
2626
* Dereferencing (using the `*` operator on) a dangling or unaligned raw pointer.
2727
* Breaking the [pointer aliasing rules]. `&mut T` and `&T` follow LLVM’s scoped
2828
[noalias] model, except if the `&T` contains an [`UnsafeCell<U>`].
29-
* Mutating non-mutable data (that is, data reached through a shared
30-
reference or data owned by an immutable binding), unless that data is contained
31-
within an [`UnsafeCell<U>`].
29+
* Mutating immutable data. All data inside a `const` is immutable. Moreover, all
30+
data reached through a shared reference or data owned by an immutable binding
31+
is immutable, unless that data is contained within an [`UnsafeCell<U>`].
3232
* Invoking undefined behavior via compiler intrinsics.
3333
* Executing code compiled with platform features that the current platform
3434
does not support (see [`target_feature`]).

0 commit comments

Comments
 (0)