diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-11 10:36:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-11 10:36:18 +0100 |
| commit | 43079147f4fcc5c0a9019fb39acdc8aa3c384f65 (patch) | |
| tree | fca5051e24aad45b4fb287208fd65c32d49e178c /src/test/ui/thinlto | |
| parent | a7c2eef2aeb23f52efc4a4bfd240292d43a61798 (diff) | |
| parent | 87f0dc63a864c6d9a3c34aa4052762dbcd316c91 (diff) | |
| download | rust-43079147f4fcc5c0a9019fb39acdc8aa3c384f65.tar.gz rust-43079147f4fcc5c0a9019fb39acdc8aa3c384f65.zip | |
Rollup merge of #69373 - tspiteri:const_int_conversion, r=oli-obk
Stabilize const for integer {to,from}_{be,le,ne}_bytes methods
All of these functions can be implemented simply and naturally as const functions, e.g. `u32::from_le_bytes` can be implemented as
```rust
(bytes[0] as u32)
| (bytes[1] as u32) << 8
| (bytes[2] as u32) << 16
| (bytes[3] as u32) << 24
```
So stabilizing the constness will not expose that internally they are implemented using transmute which is not const in stable.
Diffstat (limited to 'src/test/ui/thinlto')
0 files changed, 0 insertions, 0 deletions
