Skip to content

Commit f12eaec

Browse files
ivanbakelRalfJung
andauthored
Style fixups in immutability UB
These changes should preserve the meaning of the contents. Co-authored-by: Ralf Jung <[email protected]>
1 parent 70886e3 commit f12eaec

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/behavior-considered-undefined.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ code.
4545
* Mutating immutable bytes. All bytes inside a [`const`] item are immutable.
4646
The bytes owned by an immutable binding are immutable, unless those bytes are part of an [`UnsafeCell<U>`].
4747

48-
Moreover, the bytes [pointed to] by a shared reference, including transitively through other references (both shared and mutable) and `Box`es, are immutable: transitivity includes those references stored in fields of compound types.
48+
Moreover, the bytes [pointed to] by a shared reference, including transitively through other references (both shared and mutable) and `Box`es, are immutable; transitivity includes those references stored in fields of compound types.
4949

50-
A mutation is any write of more than 0 bytes which overlaps with any of the relevant bytes.
51-
52-
> **Note**: Writes which do not modify the byte contents (i.e. writes of a byte's value to that byte) are still mutations.
50+
A mutation is any write of more than 0 bytes which overlaps with any of the relevant bytes (even if that write does not change the memory contents).
5351
* Invoking undefined behavior via compiler intrinsics.
5452
* Executing code compiled with platform features that the current platform
5553
does not support (see [`target_feature`]), *except* if the platform explicitly documents this to be safe.

0 commit comments

Comments
 (0)