Skip to content

Commit d02c313

Browse files
committed
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.
1 parent d589fe9 commit d02c313

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@
9090
#![deny(unused_imports)]
9191
#![deny(missing_docs)]
9292

93+
#[cfg(target_pointer_width = "16")]
94+
compile_error!(
95+
"rust-miniscript currently only supports architectures with pointers wider than 16 bits"
96+
);
97+
9398
pub use bitcoin;
9499

95100
#[cfg(not(feature = "std"))]

0 commit comments

Comments
 (0)