Skip to content
Closed

0.8.6 #1771

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .github/workflows/gh-pages.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish to crates.io and create GitHub release
on:
push:
tags: ['[0-9].[0-9].*', '[0-9].[1-9][0-9].*']
jobs:
# Source: https://crates.io/docs/trusted-publishing
publish:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v6
- uses: rust-lang/crates-io-auth-action@v1
id: auth
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ jobs:
- name: Test rand (all stable features, non-MSRV)
if: ${{ matrix.toolchain != '1.36.0' }}
run: |
cargo test --target ${{ matrix.target }} --features=serde1,log,small_rng,min_const_gen
cargo test --target ${{ matrix.target }} --features=serde1,small_rng,min_const_gen
- name: Test rand (all stable features, MSRV)
if: ${{ matrix.toolchain == '1.36.0' }}
run: |
# const generics are not stable on 1.36.0
cargo test --target ${{ matrix.target }} --features=serde1,log,small_rng
cargo test --target ${{ matrix.target }} --features=serde1,small_rng
- name: Test rand_core
run: |
cargo test --target ${{ matrix.target }} --manifest-path rand_core/Cargo.toml
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
- name: Test
run: |
# all stable features:
cross test --no-fail-fast --target ${{ matrix.target }} --features=serde1,log,small_rng
cross test --no-fail-fast --target ${{ matrix.target }} --features=serde1,small_rng
cross test --no-fail-fast --target ${{ matrix.target }} --examples
cross test --no-fail-fast --target ${{ matrix.target }} --manifest-path rand_core/Cargo.toml
cross test --no-fail-fast --target ${{ matrix.target }} --manifest-path rand_distr/Cargo.toml --features=serde1
Expand All @@ -156,7 +156,7 @@ jobs:
- name: Test rand
run: |
cargo miri test --no-default-features --lib --tests
cargo miri test --features=log,small_rng
cargo miri test --features=small_rng
cargo miri test --manifest-path rand_core/Cargo.toml
cargo miri test --manifest-path rand_core/Cargo.toml --features=serde1
cargo miri test --manifest-path rand_core/Cargo.toml --no-default-features
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ A [separate changelog is kept for rand_core](rand_core/CHANGELOG.md).

You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.html) useful.

## [0.8.6] - 2026-04-14
This release back-ports a fix from v0.10. See also [#1763].

### Changes
- Deprecate feature `log` (#1764)

[#1763]: https://github.com/rust-random/rand/pull/1763

## [0.8.5] - 2021-08-20
### Fixes
- Fix build on non-32/64-bit architectures (#1144)
Expand Down
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rand"
version = "0.8.5"
version = "0.8.6"
authors = ["The Rand Project Developers", "The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down Expand Up @@ -64,7 +64,6 @@ members = [

[dependencies]
rand_core = { path = "rand_core", version = "0.6.0" }
log = { version = "0.4.4", optional = true }
serde = { version = "1.0.103", features = ["derive"], optional = true }
rand_chacha = { path = "rand_chacha", version = "0.3.0", default-features = false, optional = true }

Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ Rand is built with these features enabled by default:
- `std_rng` enables inclusion of `StdRng`, `thread_rng` and `random`
(the latter two *also* require that `std` be enabled)

Optionally, the following dependencies can be enabled:

- `log` enables logging via the `log` crate

Additionally, these features configure Rand:

- `small_rng` enables inclusion of the `SmallRng` PRNG
Expand Down
31 changes: 0 additions & 31 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,37 +59,6 @@
#[cfg(feature = "std")] extern crate std;
#[cfg(feature = "alloc")] extern crate alloc;

#[allow(unused)]
macro_rules! trace { ($($x:tt)*) => (
#[cfg(feature = "log")] {
log::trace!($($x)*)
}
) }
#[allow(unused)]
macro_rules! debug { ($($x:tt)*) => (
#[cfg(feature = "log")] {
log::debug!($($x)*)
}
) }
#[allow(unused)]
macro_rules! info { ($($x:tt)*) => (
#[cfg(feature = "log")] {
log::info!($($x)*)
}
) }
#[allow(unused)]
macro_rules! warn { ($($x:tt)*) => (
#[cfg(feature = "log")] {
log::warn!($($x)*)
}
) }
#[allow(unused)]
macro_rules! error { ($($x:tt)*) => (
#[cfg(feature = "log")] {
log::error!($($x)*)
}
) }

// Re-exports from rand_core
pub use rand_core::{CryptoRng, Error, RngCore, SeedableRng};

Expand Down
10 changes: 1 addition & 9 deletions src/rngs/adapter/reseeding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,18 +241,10 @@ where
fn reseed_and_generate(
&mut self, results: &mut <Self as BlockRngCore>::Results, global_fork_counter: usize,
) {
#![allow(clippy::if_same_then_else)] // false positive
if self.is_forked(global_fork_counter) {
info!("Fork detected, reseeding RNG");
} else {
trace!("Reseeding RNG (periodic reseed)");
}

let num_bytes = results.as_ref().len() * size_of::<<R as BlockRngCore>::Item>();

if let Err(e) = self.reseed() {
warn!("Reseeding RNG failed: {}", e);
let _ = e;
panic!("Reseeding RNG failed: {e}");
}
self.fork_counter = global_fork_counter;

Expand Down
Loading