equalitie / ouisync

A secure peer-to-peer file synchronization app.
https://ouisync.net
Mozilla Public License 2.0
49 stars 9 forks source link

Compilation errors on windows on the CI #153

Closed madadam closed 10 months ago

madadam commented 10 months ago

Type inference seems to fail for some reason, but only on windows on the CI or when cross-compiling. On an actual windows machine it builds fine.

error[E0283]: type annotations needed
   --> lib\src\blob\tests.rs:72:37
    |
72  |     let orig_content: Vec<u8> = rng.sample_iter(Standard).take(blob_len).collect();
    |                                     ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the method `sample_iter`
    |
    = note: cannot satisfy `ouisync_rand::distributions::Standard: ouisync_rand::prelude::Distribution<_>`
note: required by a bound in `ouisync_rand::Rng::sample_iter`
   --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rand-0.8.5\src\rng.rs:194:12
    |
192 |     fn sample_iter<T, D>(self, distr: D) -> distributions::DistIter<D, Self, T>
    |        ----------- required by a bound in this associated function
193 |     where
194 |         D: Distribution<T>,
    |            ^^^^^^^^^^^^^^^ required by this bound in `Rng::sample_iter`
help: consider specifying the generic arguments
    |
72  |     let orig_content: Vec<u8> = rng.sample_iter::<T, ouisync_rand::distributions::Standard>(Standard).take(blob_len).collect();
    |                                                ++++++++++++++++++++++++++++++++++++++++++++
madadam commented 10 months ago

Fixed in https://github.com/equalitie/ouisync/commit/18998fd9e6d98770912d6b4bad11556519ef67f3