Skip to content

Fix SmallRng::from_seed causing a compile error for 32-bit targets#140

Open
neonmoe wants to merge 1 commit intokyren:masterfrom
neonmoe:fix-32-bit-target-compile-err
Open

Fix SmallRng::from_seed causing a compile error for 32-bit targets#140
neonmoe wants to merge 1 commit intokyren:masterfrom
neonmoe:fix-32-bit-target-compile-err

Conversation

@neonmoe
Copy link
Copy Markdown

@neonmoe neonmoe commented Mar 13, 2026

While trying to build the crate with armv6k-nintendo-3ds as the target, I got the error:

error[E0308]: mismatched types
   --> /home/jens/.cargo/git/checkouts/piccolo-12b9ffbffc01d1c4/ce709eb/src/stdlib/math.rs:348:65
    |
348 |                         *rng.borrow_mut() = SmallRng::from_seed(seed);
    |                                             ------------------- ^^^^ expected an array with a size of 16, found one with a size of 32
    |                                             |
    |                                             arguments to this function are incorrect
    |
note: associated function defined here
   --> /home/jens/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_core-0.6.4/src/lib.rs:319:8
    |
319 |     fn from_seed(seed: Self::Seed) -> Self;
    |        ^^^^^^^^^

For more information about this error, try `rustc --explain E0308`.

While a bit puzzling, the SmallRng docs spelled it out clearly enough ("The current algorithm is Xoshiro256PlusPlus on 64-bit platforms and Xoshiro128PlusPlus on 32-bit platforms") for me to find a pretty concise fix, so here it is.

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.

1 participant