3 ms·
Wouldn't the compiler stop your second example? You're trying to assign an int16 value to b, which is now an int32.
by LambdaComplex 5y ago
Wouldn't the compiler stop your second example? You're trying to assign an int16 value to b, which is now an int32.
- zabzonk 5y agoNot in C.
- LambdaComplex 5y agoSounds like this is less "explicit casts are bad" and more "explicit casts are bad in C" then. Rust indeed errors out at compile time for the reason I stated: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ae7728b22b223249108ce460c3b43db6 https://play.rust-lang.org/?version=stable&mode=debug&editio...