Skip to content

Commit 204e887

Browse files
Lynnesbianbodil
authored andcommitted
Add documentation about smartstring being arch-dependent
1 parent fec711b commit 204e887

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ when not inlined it's pointer compatible with `String`, meaning that you can saf
2424
if it had never been a `SmartString`. (But please don't do that, there's an `Into<String>`
2525
implementation that's much safer.)
2626

27+
## Supported architectures
28+
`smartstring` currently doesn't build on 32-bit big endian architectures like `powerpc`, so its use
29+
in any crates that intend to run on those architectures should ideally be gated behind a
30+
[platform specific dependency](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies)
31+
in your `Cargo.toml`, like so:
32+
```toml
33+
[target.'cfg(not(all(target_endian = "big", target_pointer_width = "32")))'.dependencies]
34+
smartstring = "0.2"
35+
```
36+
37+
This will ensure that `cargo` does not try to build `smartstring` on these unsupported
38+
architectures, which will otherwise [always fail](https://github.com/bodil/smartstring/blob/v0.2.9/src/config.rs#L91-L93).
39+
2740
## Caveat
2841

2942
The way `smartstring` gets by without a discriminant is dependent on the memory layout of the

0 commit comments

Comments
 (0)