Rollup merge of #33745 - postmodern:patch-1, r=steveklabnik
Clarify wording in `transmute` example * Change "four eights" to "four u8s" * Change "a 32" to "a u32"
This commit is contained in:
commit
4a3ba87d82
@ -135,14 +135,14 @@ cast four bytes into a `u32`:
|
||||
```rust,ignore
|
||||
let a = [0u8, 0u8, 0u8, 0u8];
|
||||
|
||||
let b = a as u32; // four eights makes 32
|
||||
let b = a as u32; // four u8s makes a u32
|
||||
```
|
||||
|
||||
This errors with:
|
||||
|
||||
```text
|
||||
error: non-scalar cast: `[u8; 4]` as `u32`
|
||||
let b = a as u32; // four eights makes 32
|
||||
let b = a as u32; // four u8s makes a u32
|
||||
^~~~~~~~
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user