mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Fix incorrect implication of transmuting slices
transmute<&[u8]> would be useful and as a beginner it is confusing to see documents casually confuse the types of &[u8] and [u8; SZ]
This commit is contained in:
parent
3a37c2f052
commit
55d86b9da8
@ -1187,7 +1187,7 @@ extern "rust-intrinsic" {
|
||||
/// Below are common applications of `transmute` which can be replaced with safer
|
||||
/// constructs.
|
||||
///
|
||||
/// Turning raw bytes (`&[u8]`) into `u32`, `f64`, etc.:
|
||||
/// Turning raw bytes (`[u8; SZ]`) into `u32`, `f64`, etc.:
|
||||
///
|
||||
/// ```
|
||||
/// let raw_bytes = [0x78, 0x56, 0x34, 0x12];
|
||||
|
Loading…
Reference in New Issue
Block a user