|
|
|
|
|
by devit
3075 days ago
|
|
I think both "as" and using "transmute" for non-exceptional circumstances are mistakes in Rust. There should instead be a bunch of type-specific cast operators that can check things like alignment and that what you intended to be a zero-extending integer cast is not in fact truncating to a smaller integer type, and so on. It's not too late to deprecate "as" and discourage using "transmute" in favor of those. |
|