Sisu
E0099

todo written another way

ErrorSafe fix

Built from the repository at commit a8614dc.

todo is a keyword, not a function or a macro. It is written bare, todo, or with one message in parentheses, todo("why"). Rust's todo! and todo!("why"), and the empty call todo(), are errors at the first extra token.

Why

Sisu has no macros, so the ! of Rust's todo! means nothing here, and todo() with nothing in the parentheses says no more than bare todo. Each form has one meaning, so the fix is safe: it removes the !, the (), or both, which leaves todo or todo("why"). When a word follows with no space, as in todo!x, the removal would join it to todo, so the fix is unsafe.

Broken

fn area(width: i64, height: i64) -> i64 {
    todo!("multiply")
}

fn main() {
    print(area(2, 3))
}

What sisu says

error[E0099]: `todo` takes one message in parentheses, or none
 --> E0099.sisu:2:9
  |
2 |     todo!("multiply")
  |         ^
  |
help: remove it
  |
2 -     todo!("multiply")
2 +     todo("multiply")
  |

sisu: 1 error
sisu: for more on a code, run `sisu explain <code>`: E0099

Fixed

fn area(width: i64, height: i64) -> i64 {
    todo("multiply")
}

fn main() {
    print(area(2, 3))
}

Related

  • W0003: todo left in the program.