S0049: unknown pattern type or enum variant
Generated from rellum-diagnostics/src/db.rs.
Explanation
Record and enum patterns must name known types, and enum variant patterns must name a variant declared by the enum. Unknown names cannot be mapped to a payload layout.
Common causes
- misspelling a record or enum type in a pattern
- forgetting to import the type used by a pattern
- matching an enum variant name that is not declared on that enum
Canonical fixes
- use the declared type and variant names
Before:
match conn
Connection::Online { handle } => handle
After:
match conn
Connection::Connected { handle } => handle
- declare or import the type before matching
Code example
match conn
Connection::Online { handle } => handle