From 6f81ec24ba891341c0dadfae21dbe8e82ba9fe04 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Wed, 12 Aug 2026 18:57:07 +0200 Subject: [PATCH] fix(ci): gate C counts comments, and a comment named the env mutators verbatim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 55a3d8b9 (#181) added the edition-2024 lint-level rationale to the session bin's header naming std::env::set_var/remove_var — gate C's grep counts comments by contract, so main went red at 5 mentions against the 4-call-site baseline. Reword the comment instead of raising the baseline: a baseline of 5 with one comment inside would hide the next real call site. Verified: scripts/ci/check-unsafe-hygiene.sh clean, cargo fmt clean. --- clients/session/src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/clients/session/src/main.rs b/clients/session/src/main.rs index 26d50dca..7588d695 100644 --- a/clients/session/src/main.rs +++ b/clients/session/src/main.rs @@ -13,10 +13,12 @@ //! the first presented frame, `stats:` lines per 1 s window, one `{"error": …}` / //! `{"ended": …}` JSON line on the way out. Logs go to stderr. Exit codes: 0 clean end, //! 2 connect failed, 3 trust rejected / pairing required, 4 presenter init failed. -// `deny`, not `forbid`: edition 2024 makes `std::env::set_var`/`remove_var` unsafe (WP20 — -// the env-mutation class made visible), and this bin's three single-threaded-startup env -// writes carry documented SAFETY comments under localized `#[allow(unsafe_code)]` (the -// pf-update idiom). A `forbid` cannot be overridden at those sites and refuses the file. +// `deny`, not `forbid`: edition 2024 makes the std process-environment mutators unsafe +// (WP20 — the env-mutation class made visible; named-API mentions here would count against +// the unsafe-hygiene gate C baseline, which tracks this file's real call sites), and this +// bin's three single-threaded-startup env writes carry documented SAFETY comments under +// localized `#[allow(unsafe_code)]` (the pf-update idiom). A `forbid` cannot be overridden +// at those sites and refuses the file. #![deny(unsafe_code)] #[cfg(all(any(target_os = "linux", windows), feature = "ui"))] -- 2.54.0