Ok so can anyone explain to me why anyone should care about the semantics of `match never { x => { ... } }`? Isn't the match dead code?
TL;DR: match (!,) {} should compile and evaluating it should be UB making it the same as match ! {}
-
-
The rest of it is just semantics of when matching a trap value can result in UB
-
it seems like the actual question is just "is it ok to unify mem::uninitialized with Never", which seems like "obviously not"?
- 3 more replies
New conversation -
-
-
Main goal of static typing is to avoid UB. A construct guaranteed statically to result in UB should be rejected statically.
-
Unsafe code can violate the type system however it pleases.
- 4 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.