Currently, our classification of casts is kind of a mess:
- We have
mir::CastKind, but it has a Misc variant and most casts fall in that category (this is what ends up in the MIR).
- We also have
ty::cast::CastKind that has a seemingly independent classification (no idea where this is used).
- We have a
CastTy type, but can it really represent all types in a cast? If yes, I'd expect to see unwraps around here.
- In
thir::ExprKind, we have Cast and Pointer expressions, the latter also being casts.
I don't know how these all relate, but it looks like some cleanup is dearly necessary here.
Currently, our classification of casts is kind of a mess:
mir::CastKind, but it has aMiscvariant and most casts fall in that category (this is what ends up in the MIR).ty::cast::CastKindthat has a seemingly independent classification (no idea where this is used).CastTytype, but can it really represent all types in a cast? If yes, I'd expect to seeunwraps around here.thir::ExprKind, we haveCastandPointerexpressions, the latter also being casts.I don't know how these all relate, but it looks like some cleanup is dearly necessary here.