Skip to content

fix(sanitizer): add wildcard arms to non-exhaustive InjectionEnforcementMode match#4562

Merged
bug-ops merged 1 commit into
mainfrom
4557-non-exhaustive-sanitizer
May 28, 2026
Merged

fix(sanitizer): add wildcard arms to non-exhaustive InjectionEnforcementMode match#4562
bug-ops merged 1 commit into
mainfrom
4557-non-exhaustive-sanitizer

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented May 28, 2026

Summary

  • InjectionEnforcementMode in zeph-config is #[non_exhaustive], requiring a wildcard arm in all external match expressions
  • Two match sites in crates/zeph-sanitizer/src/sanitizer.rs (regex_verdict, binary_score_to_verdict) lacked _ arms, causing E0004 when building with --features classifiers
  • Replace the explicit Warn => Suspicious + _ => Suspicious duplicate pattern with a single _ => Suspicious arm in both sites

Test plan

  • cargo build -p zeph-sanitizer --features classifiers,zeph-memory/sqliteFinished with no errors
  • cargo clippy -p zeph-sanitizer --features classifiers,zeph-memory/sqlite -- -D warnings — clean
  • cargo nextest run -p zeph-sanitizer --features classifiers,zeph-memory/sqlite — 343 passed, 2 skipped
  • cargo +nightly fmt --check — clean

Closes #4557

…entMode match

InjectionEnforcementMode is #[non_exhaustive] in zeph-config; match expressions
in regex_verdict and binary_score_to_verdict lacked wildcard arms, causing E0004
when compiling zeph-sanitizer with --features classifiers.

Replace explicit Warn/_ duplicate pattern with a single _ => Suspicious arm in
both match sites. Closes #4557
@github-actions github-actions Bot added rust Rust code changes bug Something isn't working size/XS Extra small PR (1-10 lines) labels May 28, 2026
@bug-ops bug-ops enabled auto-merge (squash) May 28, 2026 20:44
@bug-ops bug-ops merged commit 56a75c6 into main May 28, 2026
32 checks passed
@bug-ops bug-ops deleted the 4557-non-exhaustive-sanitizer branch May 28, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rust Rust code changes size/XS Extra small PR (1-10 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(sanitizer): non-exhaustive InjectionEnforcementMode breaks build with --features classifiers

1 participant