libs/vulkan/zerocopy/agent_docs/validation.md
This document covers the procedures and requirements for validating changes to the project, including linting, testing, and pre-submission checks.
Clippy should always be run on the nightly toolchain.
./cargo.sh +nightly clippy
./cargo.sh +nightly clippy --tests
lib.rs will
cause CI to fail.
deny list in src/lib.rs.Ensure the library builds on all supported toolchains and that Clippy passes.
./cargo.sh +msrv check --tests --features __internal_use_only_features_that_work_on_stable
./cargo.sh +stable check --tests --features __internal_use_only_features_that_work_on_stable
./cargo.sh +nightly check --tests --all-features
./cargo.sh +nightly clippy --tests --all-features --workspace
Note: Tests are rarely toolchain-sensitive. Running tests on nightly is
usually sufficient.
mod tests module within the source
file they test.zerocopy: Place in tests/ui-* (top-level). The top-level tests
directory contains only UI tests.zerocopy-derive: Place in zerocopy-derive/tests/ui-*.zerocopy-derive/tests.zerocopy-derive/src/output_tests.rs.mod proofs module
within the source file they test.
unsafe code or code relied upon by unsafe blocks. Unlike
testing, which checks specific inputs, Kani proves properties for all
possible inputs.#[kani::proof].kani::any() to generate arbitrary inputs.kani::assume(condition) to constrain inputs to
valid states (e.g., align.is_power_of_two()).assert!(condition) to verify the properties you
want to prove.model-checking/kani-github-action with
specific feature flags to ensure compatibility.When editing code gated by a feature, compile with and without that feature.
./cargo.sh +stable check --tests
./cargo.sh +stable check --tests --feature foo