rust/library/core/src/str
Eduardo Sánchez Muñoz 93ae6f80e3 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`.
2022-04-15 17:04:59 +02:00
..
converts.rs Clarify str::from_utf8_unchecked's invariants 2022-04-10 15:04:57 -05:00
count.rs Make some usize-typed masks definition agnostic to the size of usize 2022-04-15 17:04:59 +02:00
error.rs Fill in tracking issues for const_str_from_utf8 and const_str_from_utf8_unchecked_mut features 2021-11-18 14:04:01 +03:00
iter.rs Optimize core::str::Chars::count 2022-02-05 11:15:17 -08:00
lossy.rs Delete Utf8Lossy::from_str 2021-12-08 22:54:51 -08:00
mod.rs Auto merge of #95760 - Dylan-DPC:rollup-uskzggh, r=Dylan-DPC 2022-04-07 09:50:11 +00:00
pattern.rs Add char array without ref Pattern impl 2021-07-28 16:13:46 -05:00
traits.rs Constify slice index for strings 2022-03-06 17:28:50 +11:00
validations.rs Make some usize-typed masks definition agnostic to the size of usize 2022-04-15 17:04:59 +02:00