Skip to content

Commit 96a811a

Browse files
committed
Fix warning block for pointer<->integer cast expression.
1 parent b794f8a commit 96a811a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/expressions/operator-expr.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,12 @@ If the integer type is smaller than the pointer type, the address may be truncat
388388
Casting from an integer to a raw pointer interprets the integer as a memory address and produces a pointer referencing that memory.
389389

390390
<div class="warning">
391+
391392
Warning:
392393
This interacts with the Rust memory model, which is still under development.
393394
A pointer obtained from this cast may suffer additional restrictions even if it is bitwise equal to a valid pointer.
394395
Dereferencing such a pointer may be <a href="../behavior-considered-undefined.md">undefined behavior</a> if aliasing rules are not followed.
396+
395397
</div>
396398

397399
A trivial example of sound address arithmetic:

0 commit comments

Comments
 (0)