tripon[github]

diagnostic codes / Types

E0205 unhandled-result

A `result` was evaluated and its value dropped.

E0205unhandled-resultResult value ignored; spread with ? or match
severityerror
bandTypes
in the v0 bootstrapemitted
explainralt explain E0205

A `result<T, E>` in statement position is a decision the program has not made. The checker rejects it unless the value is consumed by `match` or propagated with `?`. The same rule applies to a `result` returned from a call that is not the last expression of a `return`.

What it looks like

e0205.tp
use tier core;

fn f() -> result<i32, str> {
    return ok(1);
}

fn main() -> i32 {
    f();
    return 0;
}
ralt check e0205.tp
e0205.tp:8:5: error: result<i32, str> value evaluated and dropped
  [E0205 unhandled-result] Result value ignored; spread with ? or match

What to do

  • Propagate with `?` from a function whose return type matches the error type.
  • Handle both arms with `match` if this is the function that decides.
  • Bind the value and handle it later — the check is on the drop, not on the call.

Why the code exists

An ignored error is the bug that survives every test that only exercises the happy path. Making the drop a compile error is the only place it can be caught without running the failure.

What ralt explain says

ralt explain E0205
E0205
severity: error
name: unhandled-result
hint: Result value ignored; spread with ? or match

Related