Why this fires¶
Postfix ? and the fallible pipe ?> require a value that can fail:
T?, Option<T>, or Result<T, E>. Applying either operator to a statically
plain value has no failure path to propagate.
fn invalid() -> int {
42? // error[TE832]: `int` is not fallible
}Fix it¶
Remove the operator when the value is already plain:
fn valid() -> int { 42 }If the operation can fail, give it an honest nilable, Option, or Result
return type and make the enclosing function able to return the same failure.