Reformat cast expression details.
Now it's not one big list.
@@ -331,7 +331,8 @@ Here `*T` means either `*const T` or `*mut T`.
### Semantics
-* Numeric cast
+#### Numeric cast
+
* Casting between two integers of the same size (e.g. i32 -> u32) is a no-op
* Casting from a larger integer to a smaller integer (e.g. u32 -> u8) will
truncate
@@ -353,25 +354,6 @@ Here `*T` means either `*const T` or `*mut T`.
* Casting from an f64 to an f32 will produce the closest possible f32 \*\*
* if necessary, rounding is according to `roundTiesToEven` mode \*\*\*
* on overflow, infinity (of the same sign as the input) is produced
-* Enum cast
- * Casts an enum to its discriminant, then uses a numeric cast if needed.
-* Primitive to integer cast
- * `false` casts to `0`, `true` casts to `1`
- * `char` casts to the value of the code point, then uses a numeric cast if needed.
-* `u8` to `char` cast
- * Casts to the `char` with the corresponding code point.
-* Pointer to address cast
- * Casting from a valid raw pointer to `usize` will produce the address that is pointed to.
-
- The pointer's provenance is lost in this conversion.
-* Address to pointer cast
- * 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.
-
- <div class="warning">
- Warning:
- The two pointers are not equivalent.
- Dereferencing the pointer obtained from the address to pointer cast may be <a href="../behavior-considered-undefined.md">undefined behavior</a> if aliasing rules are not followed.
- </div>
\* if integer-to-float casts with this rounding mode and overflow behavior are
not supported natively by the hardware, these casts will likely be slower than
@@ -385,6 +367,33 @@ expected.
number, preferring the one with an even least significant digit if exactly
halfway between two floating point numbers.
+#### Enum cast
+
+Casts an enum to its discriminant, then uses a numeric cast if needed.
+
+#### Primitive to integer cast
+
+* `false` casts to `0`, `true` casts to `1`
+* `char` casts to the value of the code point, then uses a numeric cast if needed.
+8` to `char` cast
+* Casts to the `char` with the corresponding code point.
+
+#### Pointer to address cast
+
+Casting from a valid raw pointer to `usize` will produce the address that is pointed to.
+
+The pointer's provenance is lost in this conversion.
+
+#### Address to pointer cast
+
+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.
+
+<div class="warning">
+Warning:
+The two pointers are not equivalent.
+Dereferencing the pointer obtained from the address to pointer cast may be <a href="../behavior-considered-undefined.md">undefined behavior</a> if aliasing rules are not followed.
+</div>
+
## Assignment expressions
> **<sup>Syntax</sup>**\
