rust/library/compiler-builtins
Trevor Gross beb34db83d Split cast into cast and cast_lossy
There is a difference in intent between wishing to cast and truncate the
value, and expecting the input to be within range. To make this clear,
add separate `cast_lossy` and `cast_from_lossy` to indicate what that
truncation is intended, leaving `cast` and `cast_from` to only be casts
that expected not to truncate.

Actually enforcing this at runtime is likely to have a cost, so just
`debug_assert!` that `cast` doesn't truncate.
2025-01-11 18:28:45 -05:00
..
2025-01-11 18:28:45 -05:00