about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-04-16 14:26:01 +0200
committerGitHub <noreply@github.com>2022-04-16 14:26:01 +0200
commit4ed76271170ed781f0fc079ead9a5997a96f984f (patch)
tree54f4c4c2833da57713bdeda3f32a5f840cd2e087 /compiler/rustc_codegen_gcc
parent1bce78aa97d305e354c757ce17357d47d0b21065 (diff)
parent93ae6f80e37797ae82cc5d5c1875972fd76d0177 (diff)
downloadrust-4ed76271170ed781f0fc079ead9a5997a96f984f.tar.gz
rust-4ed76271170ed781f0fc079ead9a5997a96f984f.zip
Rollup merge of #96081 - eduardosm:masks_usize_size_agnostic, r=yaahc
Make some `usize`-typed masks definitions 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 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions