From d02c31309985cbae8af4ea0f61272c036737a639 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 1 Jul 2022 10:54:34 +1000 Subject: [PATCH] Explicitly do not support 16 bit architectures We cast `u32` to `usize` in a bunch of places, this will cause strange behaviour because of truncation on 16 bit architectures. Add a compile time check to explicitly not support 16 bit architectures. --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index dd0888624..69713728e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,6 +90,11 @@ #![deny(unused_imports)] #![deny(missing_docs)] +#[cfg(target_pointer_width = "16")] +compile_error!( + "rust-miniscript currently only supports architectures with pointers wider than 16 bits" +); + pub use bitcoin; #[cfg(not(feature = "std"))]