You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cargo +stable build
error[E0277]: the trait bound `rngs::jitter::TimerError: std::error::Error` is not satisfied
--> /home/japaric/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.5.5/src/rngs/jitter.rs:269:9
|
269 | Error::with_cause(ErrorKind::Unavailable,
| ^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `rngs::jitter::TimerError`
If I pin the rand 0.4 version to 0.4.3 then this crate compiles:
is probably unconditionally enabling the "std" feature of the rand_core crate, even if the target target_env is not "sgx". If that's the case then this sounds like a Cargo bug.
Ah, the 0.4 series doesn't use rand_core. The extra dependency here... surely shouldn't do anything if you are not targetting SGX?
So your build uses Rand 0.4 and 0.5, and you are not using std but now somehow rand_core requires std (because this section doesn't disable default features)... @newpavlov beat me to it.
But I don't get why it matters since you're not targetting SGX?
Activity
japaric commentedon Jan 9, 2019
If I had to guess, this addition
is probably unconditionally enabling the "std" feature of the
rand_corecrate, even if the targettarget_envis not "sgx". If that's the case then this sounds like a Cargo bug.newpavlov commentedon Jan 9, 2019
It's incorrect configuration, the cited TOML should be:
And
stdfeature forrand_coreshould be enabled together withrandstdfeature.(I wonder if it's worth to do such backports, though.)
dhardy commentedon Jan 9, 2019
Ah, the 0.4 series doesn't use
rand_core. The extra dependency here... surely shouldn't do anything if you are not targetting SGX?So your build uses Rand 0.4 and 0.5, and you are not using
stdbut now somehowrand_corerequiresstd(because this section doesn't disable default features)... @newpavlov beat me to it.But I don't get why it matters since you're not targetting SGX?
dhardy commentedon Jan 9, 2019
@newpavlov want to make the PR for 0.4.5?
newpavlov commentedon Jan 9, 2019
I think it's the same bug in cargo which enables features enabled in
dev-dependenciesfor non-dev builds.fix rust-random#688
dhardy commentedon Jan 9, 2019
@japaric can you test 0.4.5 please?
japaric commentedon Jan 9, 2019
@dhardy I checked and it works without a problem. Thanks for the quick fix!