Skip to main content
ai-slop/rust-todo-stubmanual fix

todo! or unimplemented! stub.

A `todo!()` or `unimplemented!()` macro in Rust code. It type-checks as any return type and panics when the path runs.

Flagged shape and clean shape.

Each example shows the exact code shape the rule is looking for, then the smallest version that keeps the intent without hiding risk or adding noise.

rust-todo-stub.rs
✗ Flagged
impl Exporter for CsvExporter {
    fn export(&self, rows: &[Row]) -> Result<Vec<u8>, ExportError> {
        todo!()
    }
}
Why this trips

Deterministic line match: flags `todo!(` and `unimplemented!(` on any line that is not a `//` comment.

rust-todo-stub.rs
✓ Clean
impl Exporter for CsvExporter {
    fn export(&self, rows: &[Row]) -> Result<Vec<u8>, ExportError> {
        let mut writer = csv::Writer::from_writer(Vec::new());
        for row in rows {
            writer.serialize(row)?;
        }
        writer.into_inner().map_err(ExportError::from)
    }
}
What changed

Implement the path, or return an error the caller can handle. If the work is genuinely deferred, track it in a ticket rather than a runtime panic.

Agents use the macros to make a signature compile while they work elsewhere, and the placeholder ships.

How this rule is justified.

Rule id

ai-slop/rust-todo-stub

Enforcing engine

ai-slop

Detector strategy

Deterministic line match: flags `todo!(` and `unimplemented!(` on any line that is not a `//` comment.

Legitimate code that is NOT flagged

Commented-out lines, `examples/` and `benches/` paths, and `unreachable!()` are not flagged.

Evidence

Shipped in aislop v0.8.0 among the Rust detectors, described in the release notes as unimplemented!() in library code.