]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #76492 - fusion-engineering-forks:int-bits, r=dtolnay
authorRalf Jung <post@ralfj.de>
Sat, 19 Sep 2020 09:47:45 +0000 (11:47 +0200)
committerGitHub <noreply@github.com>
Sat, 19 Sep 2020 09:47:45 +0000 (11:47 +0200)
commitfef332404341e89e4fe09416d01d82a99f7e8c5f
tree9fb63fad47aa4ea910f186ced17b03e27c5b2729
parent1720fd94e8aafc0e24a537688fe88cb1fd14831e
parent1bfe5efe8f635268646da91f1f4f6e616104b71f
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`.