E0118
Unknown variant
ErrorEnum.Name builds the variant Name of the enum, so the enum must declare a variant of that name.
Why
An enum lists every variant it has; there are no others to build. When a variant's name is close to the one written, the error suggests it, but as an unsafe fix: the closest name is not always the one you meant.
Broken
enum Expr {
Num(i64)
}
fn main() {
let _ = Expr.Nmu(2)
}
What sisu says
error[E0118]: `Expr` has no variant `Nmu` --> E0118.sisu:6:18 | 6 | let _ = Expr.Nmu(2) | ^^^ sisu: 1 error sisu: for more on a code, run `sisu explain <code>`: E0118
Fixed
enum Expr {
Num(i64)
}
fn main() {
let _ = Expr.Num(2)
}
Sisu