Description
After PR #4545 added #[non_exhaustive] to InjectionEnforcementMode in zeph-config, the match expressions in zeph-sanitizer/src/sanitizer.rs no longer compile when the classifiers feature is enabled. The _ wildcard is now required for cross-crate non-exhaustive enums, but both match arms only cover Block and Warn.
Reproduction Steps
cargo build --features full — fails with E0004 in crates/zeph-sanitizer/src/sanitizer.rs at lines 545 and 585
cargo build or cargo nextest run --workspace --lib --bins — succeeds (classifiers feature disabled by default)
Expected Behavior
cargo build --features full completes without errors.
Actual Behavior
error[E0004]: non-exhaustive patterns: `_` not covered
--> crates/zeph-sanitizer/src/sanitizer.rs:545:15
|
545 | match self.enforcement_mode {
| ^^^^^^^^^^^^^^^^^^^^^ pattern `_` not covered
error[E0004]: non-exhaustive patterns: `_` not covered
--> crates/zeph-sanitizer/src/sanitizer.rs:585:19
Two match arms in #[cfg(feature = "classifiers")] blocks — regex_verdict() and binary_score_to_verdict() — need a _ => InjectionVerdict::Suspicious wildcard arm added.
Fix
In crates/zeph-sanitizer/src/sanitizer.rs, add _ => InjectionVerdict::Suspicious to both match expressions at lines 545–548 and 585–588.
Environment
- Version: 53f8f05 (HEAD)
- Features: classifiers (via
--features full)
Logs / Evidence
Detected by CI-888 live-tester during cargo build --features full after PR #4545 (#4533 batch).
Description
After PR #4545 added
#[non_exhaustive]toInjectionEnforcementModeinzeph-config, the match expressions inzeph-sanitizer/src/sanitizer.rsno longer compile when theclassifiersfeature is enabled. The_wildcard is now required for cross-crate non-exhaustive enums, but both match arms only coverBlockandWarn.Reproduction Steps
cargo build --features full— fails with E0004 incrates/zeph-sanitizer/src/sanitizer.rsat lines 545 and 585cargo buildorcargo nextest run --workspace --lib --bins— succeeds (classifiers feature disabled by default)Expected Behavior
cargo build --features fullcompletes without errors.Actual Behavior
Two match arms in
#[cfg(feature = "classifiers")]blocks —regex_verdict()andbinary_score_to_verdict()— need a_ => InjectionVerdict::Suspiciouswildcard arm added.Fix
In
crates/zeph-sanitizer/src/sanitizer.rs, add_ => InjectionVerdict::Suspiciousto both match expressions at lines 545–548 and 585–588.Environment
--features full)Logs / Evidence
Detected by CI-888 live-tester during
cargo build --features fullafter PR #4545 (#4533 batch).