rust/library/alloc
Ralf Jung fef3324043
Rollup merge of #76492 - fusion-engineering-forks:int-bits, r=dtolnay
Add associated constant `BITS` to all integer types

Recently I've regularly come across this snippet (in a few different crates, including `core` and `std`):
```rust
std::mem::size_of<usize>() * 8
```

I think it's time for a `usize::BITS`.
2020-09-19 11:47:45 +02:00
..
benches Clean up vec benches bench_in_place style 2020-09-06 12:00:22 +08:00
src Rollup merge of #76492 - fusion-engineering-forks:int-bits, r=dtolnay 2020-09-19 11:47:45 +02:00
tests Use T::BITS instead of size_of::<T> * 8. 2020-09-19 06:54:42 +02:00
Cargo.toml