From 8aad50d4dc9b67802d36d00012bd4e45a0dae627 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 10 Jan 2026 01:28:32 +0100 Subject: [PATCH 1/2] clippy: Suppress missing_safety_doc for bindgen output --- nix-bindings-bindgen-raw/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nix-bindings-bindgen-raw/src/lib.rs b/nix-bindings-bindgen-raw/src/lib.rs index 05c7e41..63f3849 100644 --- a/nix-bindings-bindgen-raw/src/lib.rs +++ b/nix-bindings-bindgen-raw/src/lib.rs @@ -7,10 +7,19 @@ //! Normally you don't have to use this crate directly. //! Instead use `nix-store` and `nix-expr`. +// This file must only contain generated code, so that the module-level +// #![allow(...)] attributes don't suppress warnings in hand-written code. +// If you need to add hand-written code, use a submodule to isolate the +// generated code. See: +// https://github.com/nixops4/nixops4/pull/138/commits/330c3881be3d3cf3e59adebbe0ab1c0f15f6d2c9 + // Standard bindgen suppressions for C naming conventions #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] +// Clippy suppressions for generated C bindings +// bindgen doesn't generate safety docs +#![allow(clippy::missing_safety_doc)] // Rustdoc suppressions for generated C documentation // The C headers contain Doxygen-style documentation that doesn't translate // well to Rust's rustdoc format, causing various warnings: From 5b1988eb420200322400d3999fff7737697dd3a8 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 10 Jan 2026 01:28:46 +0100 Subject: [PATCH 2/2] nci: Deny warnings in dev profile --- nci.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nci.nix b/nci.nix index 053a832..cc864b0 100644 --- a/nci.nix +++ b/nci.nix @@ -8,6 +8,10 @@ # https://flake.parts/options/nix-cargo-integration nci.projects.nix-bindings = { path = ./.; + profiles = { + dev.drvConfig.env.RUSTFLAGS = "-D warnings"; + release.runTests = true; + }; drvConfig = { imports = [ # Downstream projects import this into depsDrvConfig instead