about summary refs log tree commit diff
path: root/library/std/src/sys/unix/process/process_unix.rs
diff options
context:
space:
mode:
authorEduardo Sánchez Muñoz <eduardosm-dev@e64.io>2022-04-15 16:59:40 +0200
committerEduardo Sánchez Muñoz <eduardosm-dev@e64.io>2022-04-15 17:04:59 +0200
commit93ae6f80e37797ae82cc5d5c1875972fd76d0177 (patch)
tree735804aa5c9b2f9a3f01035f867247d306323047 /library/std/src/sys/unix/process/process_unix.rs
parente7575f9670f3c837def3d186ae09366c75c7632e (diff)
downloadrust-93ae6f80e37797ae82cc5d5c1875972fd76d0177.tar.gz
rust-93ae6f80e37797ae82cc5d5c1875972fd76d0177.zip
Make some `usize`-typed masks definition agnostic to the size of `usize`
Some masks where defined as
```rust
const NONASCII_MASK: usize = 0x80808080_80808080u64 as usize;
```
where it was assumed that `usize` is never wider than 64, which is currently true.

To make those constants valid in a hypothetical 128-bit target, these constants have been redefined in an `usize`-width-agnostic way
```rust
const NONASCII_MASK: usize = usize::from_ne_bytes([0x80; size_of::<usize>()]);
```

There are already some cases where Rust anticipates the possibility of supporting 128-bit targets, such as not implementing `From<usize>` for `u64`.
Diffstat (limited to 'library/std/src/sys/unix/process/process_unix.rs')
0 files changed, 0 insertions, 0 deletions