Skip to content
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

Added ser/de to SmallRng, as it #1360

Closed
wants to merge 1 commit into from
Closed

Conversation

CGMossa
Copy link
Contributor

@CGMossa CGMossa commented Dec 5, 2023

I've added Serialize/Deserialize derive to SmallRng. It was one of the non-cryptographic number generators, and it wraps around ser/de-ble types anyways.

Also, I tried running cargo +nightly fmt, and 60 files changed. Is that normal?
I'm not gonna push those.

wraps `Rng`, which is ser/de as well.
@CGMossa
Copy link
Contributor Author

CGMossa commented Dec 5, 2023

Failing test seems unrelated to what I've done here:

error[E0405]: cannot find trait `SimdPartialOrd` in this scope
   --> src/distributions/other.rs:183:21
    |
183 |     Simd<T, LANES>: SimdPartialOrd<Mask = Mask<T, LANES>>,
    |                     ^^^^^^^^^^^^^^
   --> /rustc/0e2dac8375950a12812ec65868e42b43ed214ef9/library/core/src/cmp.rs:1082:1
    |
    = note: similarly named trait `PartialOrd` defined here
    |
help: a trait with a similar name exists
    |
183 |     Simd<T, LANES>: PartialOrd<Mask = Mask<T, LANES>>,
    |                     ~~~~~~~~~~
help: consider importing one of these items
    |
11  + use core::simd::prelude::SimdPartialOrd;
    |
11  + use std::simd::prelude::SimdPartialOrd;
    |
11  + use zerocopy::macro_util::core_reexport::simd::prelude::SimdPartialOrd;

@CGMossa
Copy link
Contributor Author

CGMossa commented Dec 5, 2023

Also, this is not getting done due to #1101

@CGMossa CGMossa closed this Dec 5, 2023
@dhardy
Copy link
Member

dhardy commented Dec 5, 2023

This won't happen because SmallRng is deliberately not portable.

Use something like Xoshiro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants