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

build(deps): bump rand from 0.7.3 to 0.8.0 #440

Closed
wants to merge 1 commit into from

Conversation

dependabot-preview[bot]
Copy link
Contributor

@dependabot-preview dependabot-preview bot commented Dec 21, 2020

Bumps rand from 0.7.3 to 0.8.0.

Changelog

Sourced from rand's changelog.

[0.8.0] - 2020-12-18

Platform support

  • The minimum supported Rust version is now 1.36 (#1011)
  • getrandom updated to v0.2 (#1041)
  • Remove wasm-bindgen and stdweb feature flags. For details of WASM support, see the getrandom documentation. (#948)
  • ReadRng::next_u32 and next_u64 now use little-Endian conversion instead of native-Endian, affecting results on Big-Endian platforms (#1061)
  • The nightly feature no longer implies the simd_support feature (#1048)
  • Fix simd_support feature to work on current nightlies (#1056)

Rngs

  • ThreadRng is no longer Copy to enable safe usage within thread-local destructors (#1035)
  • gen_range(a, b) was replaced with gen_range(a..b). gen_range(a..=b) is also supported. Note that a and b can no longer be references or SIMD types. (#744, #1003)
  • Replace AsByteSliceMut with Fill and add support for [bool], [char], [f32], [f64] (#940)
  • Restrict rand::rngs::adapter to std (#1027; see also #928)
  • StdRng: add new std_rng feature flag (enabled by default, but might need to be used if disabling default crate features) (#948)
  • StdRng: Switch from ChaCha20 to ChaCha12 for better performance (#1028)
  • SmallRng: Replace PCG algorithm with xoshiro{128,256}++ (#1038)

Sequences

  • Add IteratorRandom::choose_stable as an alternative to choose which does not depend on size hints (#1057)
  • Improve accuracy and performance of IteratorRandom::choose (#1059)
  • Implement IntoIterator for IndexVec, replacing the into_iter method (#1007)
  • Add value stability tests for seq module (#933)

Misc

  • Support PartialEq and Eq for StdRng, SmallRng and StepRng (#979)
  • Added a serde1 feature and added Serialize/Deserialize to UniformInt and WeightedIndex (#974)
  • Drop some unsafe code (#962, #963, #1011)
  • Reduce packaged crate size (#983)
  • Migrate to GitHub Actions from Travis+AppVeyor (#1073)

Distributions

  • Alphanumeric samples bytes instead of chars (#935)
  • Uniform now supports char, enabling rng.gen_range('A'..='Z') (#1068)
  • Add UniformSampler::sample_single_inclusive (#1003)

Weighted sampling

  • Implement weighted sampling without replacement (#976, #1013)
  • rand::distributions::alias_method::WeightedIndex was moved to rand_distr::WeightedAliasIndex. The simpler alternative rand::distribution::WeightedIndex remains. (#945)
  • Improve treatment of rounding errors in WeightedIndex::update_weights (#956)
  • WeightedIndex: return error on NaN instead of panic (#1005)

Documentation

  • Document types supported by random (#994)
Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

@dependabot-preview dependabot-preview bot added the dependencies Pull requests that update a dependency file label Dec 21, 2020
@iceiix
Copy link
Owner

iceiix commented Dec 22, 2020

error[E0599]: no function or associated item named `from_seed` found for struct `Lcg64Xsh32` in the current scope
768
   --> src/chunk_builder.rs:154:40
769
    |
770
154 |         let mut rng = rand_pcg::Pcg32::from_seed([
771
    |                                        ^^^^^^^^^ function or associated item not found in `Lcg64Xsh32`
772
    |
773
    = help: items from traits can only be used if the trait is in scope
774
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
775
            `use rand_core::SeedableRng;`
776

777
error[E0277]: a value of type `std::string::String` cannot be built from an iterator over elements of type `u8`
778
   --> src/screen/server_list.rs:533:34
779
    |
780
533 | ...                   .collect();
781
    |                        ^^^^^^^ value of type `std::string::String` cannot be built from `std::iter::Iterator<Item=u8>`
782
    |
783
    = help: the trait `FromIterator<u8>` is not implemented for `std::string::String`
784

785
error[E0277]: a value of type `std::string::String` cannot be built from an iterator over elements of type `u8`
786
   --> src/screen/login.rs:180:22
787
    |
788
180 |                     .collect();
789
    |                      ^^^^^^^ value of type `std::string::String` cannot be built from `std::iter::Iterator<Item=u8>`
790
    |
791
    = help: the trait `FromIterator<u8>` is not implemented for `std::string::String`
792

793
error[E0277]: the trait bound `Lcg64Xsh32: SeedableRng` is not satisfied
794
   --> src/ui/logo.rs:105:17
795
    |
796
105 |                 rand::SeedableRng::from_seed([45, 0, 0, 0, 64, 0, 0, 0, 32, 0, 0, 0, 12, 0, 0, 0]);
797
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SeedableRng` is not implemented for `Lcg64Xsh32`
798
    |
799
    = note: required by `from_seed`
800

801
error[E0277]: the trait bound `Lcg64Xsh32: RngCore` is not satisfied
802
   --> src/ui/logo.rs:106:34
803
    |
804
106 |             text_strings.shuffle(&mut r);
805
    |                                  ^^^^^^ the trait `RngCore` is not implemented for `Lcg64Xsh32`
806
    |
807
    = note: required because of the requirements on the impl of `Rng` for `Lcg64Xsh32`
808

809
warning: unused import: `Rng`
810
 --> src/chunk_builder.rs:8:18
811
  |
812
8 | use rand::{self, Rng, SeedableRng};
813
  |                  ^^^
814
  |
815
  = note: `#[warn(unused_imports)]` on by default
816

817
warning: unused import: `SeedableRng`
818
 --> src/chunk_builder.rs:8:23
819
  |
820
8 | use rand::{self, Rng, SeedableRng};
821
  |                       ^^^^^^^^^^^

Bumps [rand](https://github.com/rust-random/rand) from 0.7.3 to 0.8.0.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](rust-random/rand@0.7.3...0.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
@iceiix
Copy link
Owner

iceiix commented Dec 27, 2020

Alphanumeric samples bytes instead of chars rust-random/rand#935

This might explain the failures (u8 instead of char here):
error[E0277]: a value of type std::string::String cannot be built from an iterator over elements of type u8
value of type std::string::String cannot be built from std::iter::Iterator<Item=u8>
790
help: the trait FromIterator<u8> is not implemented for std::string::String

@iceiix
Copy link
Owner

iceiix commented Dec 27, 2020

Updating along with rand_pcg, fewer errors:

error[E0425]: cannot find function `thread_rng` in crate `rand`
   --> src/screen/server_list.rs:530:43
    |
530 | ...                   rand::thread_rng().sample(&rand::distributions::Alphanumeric)
    |                             ^^^^^^^^^^ not found in `rand`

error[E0425]: cannot find function `thread_rng` in crate `rand`
   --> src/screen/login.rs:178:37
    |
178 |                     .map(|()| rand::thread_rng().sample(&rand::distributions::Alphanumeric))
    |                                     ^^^^^^^^^^ not found in `rand`

error[E0425]: cannot find function `thread_rng` in crate `rand`
   --> src/server/mod.rs:196:15
    |
196 |         rand::thread_rng().fill(&mut shared);
    |               ^^^^^^^^^^ not found in `rand`

error[E0425]: cannot find function `thread_rng` in crate `rand`
   --> src/server/mod.rs:292:29
    |
292 |         let mut rng = rand::thread_rng();
    |                             ^^^^^^^^^^ not found in `rand`

warning: unused import: `rand::Rng`
  --> src/screen/server_list.rs:28:5
   |
28 | use rand::Rng;
   |     ^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused import: `Rng`
  --> src/screen/login.rs:20:18
   |
20 | use rand::{self, Rng};
   |                  ^^^

warning: unused import: `Rng`
  --> src/server/mod.rs:29:18
   |
29 | use rand::{self, Rng};
   |                  ^^^

could update this in #450...

@iceiix
Copy link
Owner

iceiix commented Dec 27, 2020

Updating changes in #450 to rand 0.8.0, rand_pcg 0.3.0, introduces new issues with default-features = false: thread_rng is not included, see readme:

Rand supports limited functionality in no_std mode (enabled via default-features = false). In this case, OsRng and from_entropy are unavailable (unless getrandom is enabled), large parts of seq are unavailable (unless alloc is enabled), and thread_rng and random are unavailable.

if I remove disabling default feature flags, then only two straightforward type errors:

rror[E0277]: a value of type `std::string::String` cannot be built from an iterator over elements of type `u8`
   --> src/screen/server_list.rs:533:34
    |
533 | ...                   .collect();
    |                        ^^^^^^^ value of type `std::string::String` cannot be built from `std::iter::Iterator<Item=u8>`
    |
    = help: the trait `FromIterator<u8>` is not implemented for `std::string::String`

error[E0277]: a value of type `std::string::String` cannot be built from an iterator over elements of type `u8`
   --> src/screen/login.rs:180:22
    |
180 |                     .collect();
    |                      ^^^^^^^ value of type `std::string::String` cannot be built from `std::iter::Iterator<Item=u8>`
    |
    = help: the trait `FromIterator<u8>` is not implemented for `std::string::String`

@iceiix
Copy link
Owner

iceiix commented Dec 27, 2020

Updating in #450

@iceiix iceiix closed this Dec 27, 2020
@dependabot-preview
Copy link
Contributor Author

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot-preview dependabot-preview bot deleted the dependabot/cargo/rand-0.8.0 branch December 27, 2020 23:46
iceiix added a commit that referenced this pull request Dec 27, 2020
Update to rand_pcg 0.3.0, closes #434
Update to getrandom 0.2.0
iceiix added a commit that referenced this pull request Dec 28, 2020
* Add getrandom with js feature for JavaScript web compatibility

* Update to rand 0.8.0, closes #440

* Update to rand_pcg 0.3.0, closes #434

* Update rsa_public_encrypt_pkcs1 to 0.3.0, updates rand 0.8.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant