You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/expressions/operator-expr.md
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -361,11 +361,17 @@ Here `*T` means either `*const T` or `*mut T`.
361
361
*`u8` to `char` cast
362
362
* Casts to the `char` with the corresponding code point.
363
363
* Pointer to address cast
364
-
* Casting from a valid raw pointer to `usize` will produce the address that is pointed to. Note that the pointer's provenance is lost in this conversion.
364
+
* Casting from a valid raw pointer to `usize` will produce the address that is pointed to.
365
+
366
+
The pointer's provenance is lost in this conversion.
365
367
* Address to pointer cast
366
368
* Casting from `usize` to a raw pointer will produce a raw pointer to the same location as the original pointer, if the `usize` was obtained through a pointer to address cast of a valid pointer.
367
369
368
-
Note that the two pointers are not equivalent. Dereferencing the pointer obtained from the address to pointer cast may be [undefined behavior] if aliasing rules are not followed.
370
+
<divclass="warning">
371
+
Warning:
372
+
The two pointers are not equivalent.
373
+
Dereferencing the pointer obtained from the address to pointer cast may be <ahref="../behavior-considered-undefined.md">undefined behavior</a> if aliasing rules are not followed.
374
+
</div>
369
375
370
376
\* if integer-to-float casts with this rounding mode and overflow behavior are
371
377
not supported natively by the hardware, these casts will likely be slower than
@@ -379,8 +385,6 @@ expected.
379
385
number, preferring the one with an even least significant digit if exactly
0 commit comments