From 1ad885ef1f62a8f98bbd47feff99c29be9ce6cf3 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 18 Aug 2026 18:25:41 +0000 Subject: [PATCH 1/2] Add test + fix for feature serde1 without std --- .github/workflows/test.yml | 4 ++-- src/distributions/uniform.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b827791ba8..dfccb877f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -77,7 +77,7 @@ jobs: cargo test --target ${{ matrix.target }} --all-features cargo test --target ${{ matrix.target }} --benches --features=nightly cargo test --target ${{ matrix.target }} --manifest-path rand_distr/Cargo.toml --benches - cargo test --target ${{ matrix.target }} --lib --tests --no-default-features --features min_const_gen + cargo test --target ${{ matrix.target }} --lib --tests --no-default-features --features min_const_gen,serde1 - name: Use Cargo.lock.msrv (1.36) if: ${{ matrix.toolchain == '1.36.0' }} run: | @@ -86,7 +86,7 @@ jobs: run: | cargo test --target ${{ matrix.target }} --lib --tests --no-default-features cargo build --target ${{ matrix.target }} --no-default-features --features alloc,getrandom,small_rng - cargo test --target ${{ matrix.target }} --lib --tests --no-default-features --features=alloc,getrandom,small_rng + cargo test --target ${{ matrix.target }} --lib --tests --no-default-features --features=alloc,getrandom,small_rng,serde1 cargo test --target ${{ matrix.target }} --examples - name: Test rand (all stable features, non-MSRV) if: ${{ matrix.toolchain != '1.36.0' }} diff --git a/src/distributions/uniform.rs b/src/distributions/uniform.rs index 10f98a3565..7df50388ed 100644 --- a/src/distributions/uniform.rs +++ b/src/distributions/uniform.rs @@ -602,7 +602,7 @@ where D: serde::Deserializer<'de>, { let sampler = as serde::Deserialize>::deserialize(d)?; - if sampler.max() > std::char::MAX as u32 - CHAR_SURROGATE_LEN { + if sampler.max() > core::char::MAX as u32 - CHAR_SURROGATE_LEN { return Err(serde::de::Error::custom( "bad sampler range for UniformChar", )); From 9fd5638aab500fb3b02b593a5fa484eb47c0fccd Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 18 Aug 2026 18:27:47 +0000 Subject: [PATCH 2/2] Prepare 0.8.8 --- CHANGELOG.md | 6 ++++++ Cargo.lock.msrv | 4 ++-- Cargo.toml | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4826c40ed..2ed1e0c9db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ 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.8] - 2026-08-19 +### Fixes +- Fix build for `--no-default-features --features serde1` ([#1825]) + +[#1825]: https://github.com/rust-random/rand/pull/1825 + ## [0.8.7] - 2026-07-02 ### Fixes - Fix possible memory safety violation due to deserialization of `UniformChar` from bad source ([#1804]) diff --git a/Cargo.lock.msrv b/Cargo.lock.msrv index d1115d14ca..204ff7bf22 100644 --- a/Cargo.lock.msrv +++ b/Cargo.lock.msrv @@ -98,7 +98,7 @@ dependencies = [ [[package]] name = "rand" -version = "0.8.7" +version = "0.8.8" dependencies = [ "bincode 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.138 (registry+https://github.com/rust-lang/crates.io-index)", @@ -133,7 +133,7 @@ version = "0.4.3" dependencies = [ "average 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.8.7", + "rand 0.8.8", "rand_pcg 0.3.1", "serde 1.0.156 (registry+https://github.com/rust-lang/crates.io-index)", "special 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index b3a47febba..4ce8d38a82 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rand" -version = "0.8.7" +version = "0.8.8" authors = ["The Rand Project Developers", "The Rust Project Developers"] license = "MIT OR Apache-2.0" readme = "README.md"