Merge rust-bitcoin/rust-bitcoin#1652: Clarify the intention of strange condition

d83739a980 Clarify the intention of strange condition (Martin Habovstiak)

Pull request description:

  It may not be obvious why the condition in `push_bytes` module checks for negation of 16 and 32 bit architectures rather than 64 bit. This adds a comment about it being conservative.

  Addresses https://github.com/rust-bitcoin/rust-bitcoin/pull/1190#discussion_r1111342671

ACKs for top commit:
  apoelstra:
    ACK d83739a980
  tcharding:
    ACK d83739a980

Tree-SHA512: 8a674b9869c580a007c189b0d9b0a57023b26eff3afab25322d966e0ccaff767d19dd499243d438832972f351e1e7ea4b8e387a5e3c74569816814fea258b20b
This commit is contained in:
Andrew Poelstra 2023-02-20 21:26:18 +00:00
commit 483605add2
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 2 additions and 0 deletions

View File

@ -435,6 +435,8 @@ mod error {
} }
} }
// we have 64 bits in mind, but even for esoteric sizes, this code is correct, since it's the
// conservative one that checks for errors
#[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))] #[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))]
mod error { mod error {
use core::fmt; use core::fmt;