From 117c27f801461bdb81c542bd7632f3168934beda Mon Sep 17 00:00:00 2001 From: Felipe Monteiro Date: Wed, 7 Oct 2026 02:24:17 +0000 Subject: [PATCH] Pin zerocopy to 0.8.59 in the cargo-kani tests that depend on rand zerocopy 0.8.60 added a `#[cfg(any(test, kani))]` module that uses `#[derive(KnownLayout)]`, which only exists with zerocopy's `derive` feature, so it doesn't compile under Kani as a dependency. rand 0.8 pulls zerocopy in through ppv-lite86, so these three tests fail, and with them the regression check on every PR. Remove the pin once a fixed zerocopy release is out (#4988). --- tests/cargo-kani/cbmc-unknown-lang-mode/Cargo.toml | 4 ++++ tests/cargo-kani/dependencies/Cargo.toml | 4 ++++ tests/cargo-kani/stubbing-validate-random/Cargo.toml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/tests/cargo-kani/cbmc-unknown-lang-mode/Cargo.toml b/tests/cargo-kani/cbmc-unknown-lang-mode/Cargo.toml index 5c0a1d78ff83..f54b651e14ba 100644 --- a/tests/cargo-kani/cbmc-unknown-lang-mode/Cargo.toml +++ b/tests/cargo-kani/cbmc-unknown-lang-mode/Cargo.toml @@ -9,6 +9,10 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +# zerocopy 0.8.60 (pulled in by rand through ppv-lite86) doesn't compile under `--cfg kani` +# without its `derive` feature. Remove once a fixed release is out: +# https://github.com/model-checking/kani/issues/4988 +zerocopy = "=0.8.59" getrandom = "0.2" rand = "0.8.0" diff --git a/tests/cargo-kani/dependencies/Cargo.toml b/tests/cargo-kani/dependencies/Cargo.toml index d76155063171..f2d827b0affb 100644 --- a/tests/cargo-kani/dependencies/Cargo.toml +++ b/tests/cargo-kani/dependencies/Cargo.toml @@ -8,5 +8,9 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +# zerocopy 0.8.60 (pulled in by rand through ppv-lite86) doesn't compile under `--cfg kani` +# without its `derive` feature. Remove once a fixed release is out: +# https://github.com/model-checking/kani/issues/4988 +zerocopy = "=0.8.59" memchr = { version = "2", default-features = false } rand = "0.8.4" diff --git a/tests/cargo-kani/stubbing-validate-random/Cargo.toml b/tests/cargo-kani/stubbing-validate-random/Cargo.toml index ef03456dd1aa..ef8cf1629d4a 100644 --- a/tests/cargo-kani/stubbing-validate-random/Cargo.toml +++ b/tests/cargo-kani/stubbing-validate-random/Cargo.toml @@ -6,6 +6,10 @@ version = "0.1.0" edition = "2021" [dependencies] +# zerocopy 0.8.60 (pulled in by rand through ppv-lite86) doesn't compile under `--cfg kani` +# without its `derive` feature. Remove once a fixed release is out: +# https://github.com/model-checking/kani/issues/4988 +zerocopy = "=0.8.59" rand = "0.8.5" [package.metadata.kani.unstable]