News for hackers. Stuff that matters.
Re:Rust Traits Deep Dive, Part 2 by masklinn on Wednesday June 20, 2018 @12:19PM (#17356774)
There is no type safety issue, and there is no cast. Div on integral types is explicitly implementing as an integer/truncating division: https://doc.rust-lang.org/src/core/ops/arith.rs.html#436-452

There would be no type-safety issue or cast if it were implemented as a real division either, incidentally.

There is room to argue Div should not have been implemented at all on integral types (as in Haskell where integer division is a separate operation entirely), but that's a completely different issue.

There are no comments on this comment yet.