chore(lint): suppress dead_code warnings for const-eval functions to address MSRV-specific lint behavior

This commit is contained in:
elipeter 2026-06-02 22:15:41 -05:00
parent c29cf69d42
commit 2e456c15d1
3 changed files with 4 additions and 0 deletions

View file

@ -163,6 +163,7 @@ const _: () = assert!(
/// Union of every cap bit referenced by an [`IMPACT_LATTICE`] rule, as
/// `source_cap` or `adjacent_cap`. Computed at compile time.
#[allow(dead_code)] // Called from a const assertion; MSRV lints may miss const-eval uses.
const fn rule_coverage_bits() -> u32 {
let mut acc: u32 = 0;
let mut i = 0;

View file

@ -24,6 +24,7 @@ use super::registry::{CORPUS, CORPUS_UNSUPPORTED_LANG_NEUTRAL};
use crate::labels::Cap;
/// Byte-level equality for `&'static str` usable in const eval.
#[allow(dead_code)] // Called from const-eval audit helpers on MSRV/CI compilers.
const fn str_eq(a: &str, b: &str) -> bool {
let ab = a.as_bytes();
let bb = b.as_bytes();
@ -43,6 +44,7 @@ const fn str_eq(a: &str, b: &str) -> bool {
/// Walk every `(cap, lang)` slice; for each non-benign payload check that
/// either its `benign_control.label` resolves inside the same slice or it
/// carries a non-empty `no_benign_control_rationale`.
#[allow(dead_code)] // Called from a const assertion; MSRV lints may miss const-eval uses.
const fn audit_benign_controls() -> bool {
let entries = CORPUS.entries;
let mut e = 0;

View file

@ -68,6 +68,7 @@ pub const CORPUS_VERSION: &str = "17";
/// is caught at `cargo build` rather than at test time.
const _: () = assert_corpus_version_str_matches_u32();
#[allow(dead_code)] // Called from a const assertion; MSRV lints may miss const-eval uses.
const fn assert_corpus_version_str_matches_u32() {
let int_val = crate::dynamic::corpus::CORPUS_VERSION;
let bytes = CORPUS_VERSION.as_bytes();