Skip to content

Commit 083f5f3

Browse files
committed
Document lack of support for 16-bit pointers
This clearly states lack of support for 16-bit architectures as well as adds readable `compile_error!()` call. It also fixes a few stylistic mistakes - headings (top-level should not be repeated) and missing newlines. Closes rust-bitcoin#660
1 parent 4bd3e1d commit 083f5f3

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Supports (or should support)
2020
For JSONRPC interaction with Bitcoin Core, it is recommended to use
2121
[rust-bitcoincore-rpc](https://github.com/rust-bitcoin/rust-bitcoincore-rpc).
2222

23-
# Known limitations
23+
## Known limitations
2424

25-
## Consensus
25+
### Consensus
2626

2727
This library **must not** be used for consensus code (i.e. fully validating
2828
blockchain data). It technically supports doing this, but doing so is very
@@ -36,13 +36,20 @@ Given the complexity of both C++ and Rust, it is unlikely that this will
3636
ever be fixed, and there are no plans to do so. Of course, patches to
3737
fix specific consensus incompatibilities are welcome.
3838

39+
### Support for 16-bit pointer sizes
40+
41+
16-bit pointer sizes are not supported and we can't promise they will be.
42+
If you care about them please let us know, so we can know how large the interest
43+
is and possibly decide to support them.
44+
3945
## Documentation
4046

4147
Currently can be found on [docs.rs/bitcoin](https://docs.rs/bitcoin/).
4248
Patches to add usage examples and to expand on existing docs would be extremely
4349
appreciated.
4450

45-
# Contributing
51+
## Contributing
52+
4653
Contributions are generally welcome. If you intend to make larger changes please
4754
discuss them in an issue before PRing them to avoid duplicate work and
4855
architectural mismatches. If you have any questions or ideas you want to discuss
@@ -51,6 +58,7 @@ please join us in
5158
[libera.chat](https://libera.chat).
5259

5360
## Minimum Supported Rust Version (MSRV)
61+
5462
This library should always compile with any combination of features on **Rust 1.29**.
5563

5664
Because some dependencies have broken the build in minor/patch releases, to
@@ -72,6 +80,7 @@ cargo update -p byteorder --precise "1.3.4"
7280
```
7381

7482
## Installing Rust
83+
7584
Rust can be installed using your package manager of choice or
7685
[rustup.rs](https://rustup.rs). The former way is considered more secure since
7786
it typically doesn't involve trust in the CA system. But you should be aware
@@ -80,6 +89,7 @@ Generally this isn't a problem for `rust-bitcoin` since we support much older
8089
versions than the current stable one (see MSRV section).
8190

8291
## Building
92+
8393
The library can be built and tested using [`cargo`](https://github.com/rust-lang/cargo/):
8494

8595
```
@@ -97,6 +107,7 @@ cargo test
97107
Please refer to the [`cargo` documentation](https://doc.rust-lang.org/stable/cargo/) for more detailed instructions.
98108

99109
## Pull Requests
110+
100111
Every PR needs at least two reviews to get merged. During the review phase
101112
maintainers and contributors are likely to leave comments and request changes.
102113
Please try to address them, otherwise your PR might get closed without merging
@@ -117,12 +128,12 @@ cross-chain atomic swaps) are more likely to be accepted than things which
117128
support only a single blockchain.
118129

119130

120-
# Release Notes
131+
## Release Notes
121132

122133
See [CHANGELOG.md](CHANGELOG.md).
123134

124135

125-
# Licensing
136+
## Licensing
126137

127138
The code in this project is licensed under the [Creative Commons CC0 1.0
128139
Universal license](LICENSE).

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
//! safety, including ownership and lifetime, for financial and/or cryptographic
2323
//! software.
2424
//!
25+
//! See README.md for detailed documentation about development and supported
26+
//! environments.
27+
//!
2528
//! ## Available feature flags
2629
//!
2730
//! * `std` - the usual dependency on `std` (default).
@@ -58,6 +61,12 @@
5861
#[cfg(not(any(feature = "std", feature = "no-std")))]
5962
compile_error!("at least one of the `std` or `no-std` features must be enabled");
6063

64+
// Disable 16-bit support at least for now as we can't guarantee it yet.
65+
#[cfg(target_pointer_width = "16")]
66+
compile_error!("rust-bitcoin currently only supports architectures with pointers wider
67+
than 16 bits, let us know if you want 16-bit support. Note that we do
68+
NOT guarantee that we will implement it!");
69+
6170
#[cfg(feature = "no-std")]
6271
#[macro_use]
6372
extern crate alloc;

0 commit comments

Comments
 (0)