Y
Hacker News
new
|
ask
|
show
|
jobs
by
umanwizard
777 days ago
You’re correct. Rust can’t statically prove which enum variant is inhabited. You do need a runtime switch, the difference is (at least in safe code) it statically forces you to indeed do that runtime switch.