aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-15 21:45:12 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-15 21:45:12 +0000
commit4f9d0c91fe89f5b7ffeba248269c5ca1b97532c0 (patch)
tree02226ab7d0aae65e8b9a942e87b48a3b889145d5
parentd0fccdbf8e49993e02b81531bacdc3e64c9946cb (diff)
parent2b6f36fccea47ab55d9e7e29e0d81f16e6a4b7f9 (diff)
downloadrand_core-aml_tz3_314012070.tar.gz
Change-Id: Ia3b7998bb89183a68bf1e3a2994d4d2f9a49d4f6
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp37
-rw-r--r--CHANGELOG.md5
-rw-r--r--Cargo.toml2
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA8
-rw-r--r--TEST_MAPPING94
-rw-r--r--cargo2android.json11
-rw-r--r--src/block.rs6
-rw-r--r--src/lib.rs9
10 files changed, 33 insertions, 143 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 7f98fc0..3fd44e0 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "8792268dfe57e49bb4518190bf4fe66176759a44"
+ "sha1": "3a03c9eb5350e03a3f540dba2ee34e0984f2c2c2"
}
}
diff --git a/Android.bp b/Android.bp
index 6d2506f..67a44cc 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,5 +1,4 @@
-// This file is generated by cargo2android.py --config cargo2android.json.
-// Do not modify this file as changes will be overridden on upgrade.
+// This file is generated by cargo2android.py --device --run --features=std --dependencies --tests.
package {
default_applicable_licenses: ["external_rust_crates_rand_core_license"],
@@ -42,8 +41,6 @@ rust_library {
name: "librand_core",
host_supported: true,
crate_name: "rand_core",
- cargo_env_compat: true,
- cargo_pkg_version: "0.6.3",
srcs: ["src/lib.rs"],
edition: "2018",
features: [
@@ -54,24 +51,14 @@ rust_library {
rustlibs: [
"libgetrandom",
],
- apex_available: [
- "//apex_available:platform",
- "com.android.virt",
- ],
}
-rust_test {
- name: "rand_core_test_src_lib",
- host_supported: true,
+rust_defaults {
+ name: "rand_core_defaults",
crate_name: "rand_core",
- cargo_env_compat: true,
- cargo_pkg_version: "0.6.3",
srcs: ["src/lib.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
- test_options: {
- unit_test: true,
- },
edition: "2018",
features: [
"alloc",
@@ -82,3 +69,21 @@ rust_test {
"libgetrandom",
],
}
+
+rust_test_host {
+ name: "rand_core_host_test_src_lib",
+ defaults: ["rand_core_defaults"],
+ test_options: {
+ unit_test: true,
+ },
+}
+
+rust_test {
+ name: "rand_core_device_test_src_lib",
+ defaults: ["rand_core_defaults"],
+}
+
+// dependent_library ["feature_list"]
+// cfg-if-1.0.0
+// getrandom-0.2.2 "std"
+// libc-0.2.86
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 82c8300..23d1fa5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,11 +4,6 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-## [0.6.3] - 2021-06-15
-### Changed
-- Improved bound for `serde` impls on `BlockRng` (#1130)
-- Minor doc additions (#1118)
-
## [0.6.2] - 2021-02-12
### Fixed
- Fixed assertions in `le::read_u32_into` and `le::read_u64_into` which could
diff --git a/Cargo.toml b/Cargo.toml
index 06ba1e8..51b8385 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
[package]
edition = "2018"
name = "rand_core"
-version = "0.6.3"
+version = "0.6.2"
authors = ["The Rand Project Developers", "The Rust Project Developers"]
description = "Core random number generator traits and tools for implementation.\n"
homepage = "https://rust-random.github.io/book"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 6604bc5..d460757 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "rand_core"
-version = "0.6.3"
+version = "0.6.2"
authors = ["The Rand Project Developers", "The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
diff --git a/METADATA b/METADATA
index 6c047cf..0e7aa20 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/rand_core/rand_core-0.6.3.crate"
+ value: "https://static.crates.io/crates/rand_core/rand_core-0.6.2.crate"
}
- version: "0.6.3"
+ version: "0.6.2"
license_type: NOTICE
last_upgrade_date {
year: 2021
- month: 6
- day: 21
+ month: 2
+ day: 17
}
}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index cd4547e..963506b 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,105 +1,17 @@
// Generated by update_crate_tests.py for tests that depend on this crate.
{
- "imports": [
- {
- "path": "external/rust/crates/base64"
- },
- {
- "path": "external/rust/crates/cast"
- },
- {
- "path": "external/rust/crates/crc32fast"
- },
- {
- "path": "external/rust/crates/crossbeam-deque"
- },
- {
- "path": "external/rust/crates/crossbeam-epoch"
- },
- {
- "path": "external/rust/crates/crossbeam-queue"
- },
- {
- "path": "external/rust/crates/crossbeam-utils"
- },
- {
- "path": "external/rust/crates/mio"
- },
- {
- "path": "external/rust/crates/quickcheck"
- },
- {
- "path": "external/rust/crates/rand_chacha"
- },
- {
- "path": "external/rust/crates/rand_xorshift"
- },
- {
- "path": "external/rust/crates/regex"
- },
- {
- "path": "external/rust/crates/ryu"
- },
- {
- "path": "external/rust/crates/tokio"
- }
- ],
"presubmit": [
{
- "name": "ZipFuseTest"
- },
- {
- "name": "apkdmverity.test"
- },
- {
- "name": "authfs_device_test_src_lib"
- },
- {
- "name": "keystore2_test"
- },
- {
- "name": "keystore2_test_utils_test"
- },
- {
- "name": "legacykeystore_test"
- },
- {
- "name": "microdroid_manager_test"
- },
- {
- "name": "rand_core_test_src_lib"
- },
- {
- "name": "virtualizationservice_device_test"
- }
- ],
- "presubmit-rust": [
- {
- "name": "ZipFuseTest"
- },
- {
- "name": "apkdmverity.test"
- },
- {
- "name": "authfs_device_test_src_lib"
+ "name": "rand_xorshift_device_test_tests_mod"
},
{
"name": "keystore2_test"
},
{
- "name": "keystore2_test_utils_test"
- },
- {
- "name": "legacykeystore_test"
- },
- {
- "name": "microdroid_manager_test"
- },
- {
- "name": "rand_core_test_src_lib"
+ "name": "rand_xorshift_device_test_src_lib"
},
{
- "name": "virtualizationservice_device_test"
+ "name": "rand_core_device_test_src_lib"
}
]
}
diff --git a/cargo2android.json b/cargo2android.json
deleted file mode 100644
index b73c7b4..0000000
--- a/cargo2android.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "apex-available": [
- "//apex_available:platform",
- "com.android.virt"
- ],
- "dependencies": true,
- "device": true,
- "features": "std",
- "run": true,
- "tests": true
-} \ No newline at end of file
diff --git a/src/block.rs b/src/block.rs
index a54cadf..005d071 100644
--- a/src/block.rs
+++ b/src/block.rs
@@ -114,12 +114,6 @@ pub trait BlockRngCore {
/// [`try_fill_bytes`]: RngCore::try_fill_bytes
#[derive(Clone)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
-#[cfg_attr(
- feature = "serde1",
- serde(
- bound = "for<'x> R: Serialize + Deserialize<'x> + Sized, for<'x> R::Results: Serialize + Deserialize<'x>"
- )
-)]
pub struct BlockRng<R: BlockRngCore + ?Sized> {
results: R::Results,
index: usize,
diff --git a/src/lib.rs b/src/lib.rs
index bc24270..7e847ae 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -76,17 +76,12 @@ pub mod le;
/// [`next_u32`] or [`next_u64`] since the latter methods are almost always used
/// with algorithmic generators (PRNGs), which are normally infallible.
///
-/// Implementers should produce bits uniformly. Pathological RNGs (e.g. always
-/// returning the same value, or never setting certain bits) can break rejection
-/// sampling used by random distributions, and also break other RNGs when
-/// seeding them via [`SeedableRng::from_rng`].
-///
/// Algorithmic generators implementing [`SeedableRng`] should normally have
/// *portable, reproducible* output, i.e. fix Endianness when converting values
/// to avoid platform differences, and avoid making any changes which affect
/// output (except by communicating that the release has breaking changes).
///
-/// Typically an RNG will implement only one of the methods available
+/// Typically implementators will implement only one of the methods available
/// in this trait directly, then use the helper functions from the
/// [`impls`] module to implement the other methods.
///
@@ -485,7 +480,7 @@ mod test {
// This is the binomial distribution B(64, 0.5), so chance of
// weight < 20 is binocdf(19, 64, 0.5) = 7.8e-4, and same for
// weight > 44.
- assert!((20..=44).contains(&weight));
+ assert!(weight >= 20 && weight <= 44);
for (i2, r2) in results.iter().enumerate() {
if i1 == i2 {