sb-dev/openquant / .agents/skills/rust-review
rust-review
VerifiedReview Rust crates, services, or libraries for safe/unsafe boundary issues, memory safety, concurrency hazards, panic-induced denial of service, FFI safety, and async runtime mistakes. Use for a Rust security audit, especially unsafe, FFI, or concurrent code.
upstream/prompts/general/result-discarded-finder.md
View on GitHub---
name: result-discarded-finder
description: Detects Result<T,E> silently dropped via `let _ =`, ignoring errors that must propagate
---
**Finding ID Prefix:** `RESDISC`.
**Gates:**
1. `let _ = expr;` OR a `Result`-returning expression in statement position without `?`, `match`, `if let`, or `unwrap`/`expect` (rustc's built-in `unused_must_use` lint — on by default, *not* a Clippy lint — warns on the bare-statement form, but it does **not** fire on `let _ = expr`, which is the more common silent discard).
2. The expression is genuinely a silently-discarded `Result` / `#[must_use]` value — i.e. the error is not handled on any path (no `?`, `match`, `if let`, `unwrap`/`expect`, or assignment that inspects it). Gate on *that*, **not** on your guess at impact. Record the likely impact (write / lock-acquire / validation / crypto-verification failure) as context in the finding, but file **every** confirmed silent discard regardless of perceived severity — the fp+severity judge ranks it. Dropping a confirmed discard because it looks low-impact is forbidden (worker protocol rule 4: never gate filing on guessed severity/security-relevance).
**FPs:**
- Caller explicitly accepts the result, documented with a comment.
- Result is a best-effort write to a purely cosmetic/diagnostic `stdout`/`stderr` sink with no correctness requirement. (Do **not** wave away a discarded `io::Result` from a write to a *persisted* / audit / integrity / network sink — that is a real finding; gate 2 forbids dropping it on a severity guess.)
**Patch:** propagate via `?` or `.map_err(...)?`.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |