3 ms·
From the discussion linked[1] in another reply at your level, I believe the proposed automatic type conversions are only for when there's no data loss, and ther
by kbenson 11y ago
From the discussion linked[1] in another reply at your level, I believe the proposed automatic type conversions are only for when there's no data loss, and there needs to be explicit conversions whenever loss of information is possible. That is, it's implicit for i32 -> u32, or i32 -> i64, but not for something like i32 -> i8 (such as the int to char conversion you mentioned), which would need to be explicitly converted.
1: https://internals.rust-lang.org/t/implicit-widening-polymorphic-indexing-and-similar-ideas/1141 https://internals.rust-lang.org/t/implicit-widening-polymorp...