-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fixed-hash]: fix build with default-features
#268
Conversation
alloc is required by the `rustc-hex` implementation which make the `std` build to fail. This commit re-exports `alloc` for both std and no-std to fix this problem
@@ -10,7 +10,6 @@ | |||
|
|||
// Re-export liballoc using an alias so that the macros can work without | |||
// requiring `extern crate alloc` downstream. | |||
#[cfg(not(feature = "std"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could also be #[cfg(any(no_std, feature = "rustc-hex"))]
but std
is using rustc-hex
so I re-exported alloc
for all instead,
alloc_
std
build again
which command fails exactly? |
[dependencies]
fixed-hash = { path = "../parity-common/fixed-hash" } error[E0433]: failed to resolve: could not find `alloc_` in `$crate`
--> src/main.rs:3:1
|
3 | / construct_fixed_hash! {
4 | | /// My 256 bit hash type.
5 | | struct H256(32);
6 | | }
| |_^ could not find `alloc_` in `$crate` As you can see here, |
std
build againdefault-features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation!
…h/parity-common into ao-rocksdb-switch-to-upstream2 * 'ao-rocksdb-switch-to-upstream2' of github.com:paritytech/parity-common: kvdb-rocksdb: remove lz4 feature as it has no effect for now travis: try to fix wasmpack chrome test on macOS (#263) kvdb-rocksdb: please the CI kvdb-rocksdb: do not account for default column memory budget Use 2018 edition for rustfmt (#266) [fixed-hash]: re-export `alloc_` (#268) kvdb-web: async-awaitify (#259)
* master: Compile triehash for no_std (#280) [kvdb-rocksdb] Use "pinned" gets to avoid allocations (#274) [kvdb-rocksdb] Release 0.2 (#273) [kvdb-rocksdb] switch to upstream (#257) travis: try to fix wasmpack chrome test on macOS (#263) Use 2018 edition for rustfmt (#266) [fixed-hash]: re-export `alloc_` (#268) kvdb-web: async-awaitify (#259) kvdb-rocksdb: configurable memory budget per column (#256) Bump rlp crate version. (#270) Introduce Rlp::at_with_offset method. (#269) Make fixed-hash test structs public (#267) Migrate primitive types to 2018 edition (#262) upgrade tiny-keccak to 2.0 (#260)
alloc is required by the
rustc-hex
implementation which makes the build withdefault-features
to fail.This commit re-exports
alloc
for both std and no-std to fix this problem