Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bitcoin: Compile time assert on index size
Currently we enforce that our code only runs on machines with a certain pointer width (32 or 64). One of the underlying reasons is because of requirements in consensus code in Bitcoin Core which requires containers with more than 2^16 (65536) items [0]. We can better express our requirements by asserting on Rust's index size (the `usize` type). As a side benefit, there is active work [1] to make Rust support architectures where pointer width != idex size. With this patch applied `rust-bitcoin` will function correctly even if that work progresses. - [0] rust-bitcoin#2929 (comment) - [1] rust-lang/rust#65473
- Loading branch information