From 5dc5e0bf25572d93917c43d00e94a022b3557b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delmas?= Date: Wed, 22 May 2024 15:59:58 -0400 Subject: [PATCH] New section about linter configuraton checking in the doc. (#3198) Resolves #3197 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. Co-authored-by: Remi Delmas --- docs/src/usage.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/src/usage.md b/docs/src/usage.md index 77def63d3651..fced7a047804 100644 --- a/docs/src/usage.md +++ b/docs/src/usage.md @@ -68,6 +68,16 @@ default-unwind = 1 The options here are the same as on the command line (`cargo kani --help`), and flags (that is, command line arguments that don't take a value) are enabled by setting them to `true`. +Starting with Rust 1.80 (or nightly-2024-05-05), every reachable #[cfg] will be automatically checked that they match the expected config names and values. +To avoid warnings on `cfg(kani)`, we recommend adding the `check-cfg` lint config in your crate's `Cargo.toml` as follows: + +```toml +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)'] } +``` + +For more information please consult this [blog post](https://blog.rust-lang.org/2024/05/06/check-cfg.html). + ## The build process When Kani builds your code, it does two important things: