]> git.lizzy.rs Git - rust.git/commit
Make saturating u128 -> f32 casts the default behavior
authorRobin Kruppe <robin.kruppe@gmail.com>
Thu, 9 Nov 2017 23:24:05 +0000 (00:24 +0100)
committerRobin Kruppe <robin.kruppe@gmail.com>
Fri, 10 Nov 2017 09:12:30 +0000 (10:12 +0100)
commit59524410a7eb3c6afe3ac01b4257d916efe2421b
tree155dd4768dfc1aff7795dba6784126f9f90326e3
parentf1ea23e2cc72cafad1dc25a06c09ec2de8e323eb
Make saturating u128 -> f32 casts the default behavior

... rather than being gated by -Z saturating-float-casts.
There are several reasons for this:

1. Const eval already implements this behavior.
2. Unlike with float->int casts, this behavior is uncontroversially the
right behavior and it is not as performance critical. Thus there is no
particular need to make the bug fix for u128->f32 casts opt-in.
3. Having two orthogonal features under one flag is silly, and never
should have happened in the first place.
4. Benchmarking float->int casts with the -Z flag should not pick up
performance changes due to the u128->f32 casts (assuming there are any).

Fixes #41799
src/librustc/session/config.rs
src/librustc_trans/mir/rvalue.rs
src/test/codegen/unchecked-float-casts.rs
src/test/run-pass/saturating-float-casts.rs
src/test/run-pass/u128-as-f32.rs [new file with mode: 0644]