Skip to content

Commit 18267fc

Browse files
committed
Fix typo in type cast expression table
Typo originally reported in the compiler issue tracker: rust-lang/rust#81686 (comment) It doesn't make sense to cast a pointer to a float, and it's currently rejected by the compiler: error[E0606]: casting `*const T` as `f32` is invalid --> test.rs:2:5 | 2 | a as f32 | ^^^^^^^^ error: aborting due to previous error I think what's meant here is "integer type" rather than "numeric type".
1 parent 152f877 commit 18267fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/expressions/operator-expr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ well as the following additional casts. Here `*T` means either `*const T` or
343343
| `bool` or `char` | Integer type | Primitive to integer cast |
344344
| `u8` | `char` | `u8` to `char` cast |
345345
| `*T` | `*V` where `V: Sized` \* | Pointer to pointer cast |
346-
| `*T` where `T: Sized` | Numeric type | Pointer to address cast |
346+
| `*T` where `T: Sized` | Integer type | Pointer to address cast |
347347
| Integer type | `*V` where `V: Sized` | Address to pointer cast |
348348
| `&[T; n]` | `*const T` | Array to pointer cast |
349349
| [Function item] | [Function pointer] | Function item to function pointer cast |

0 commit comments

Comments
 (0)