Skip to content

Remove -Zsaturating-float-casts flag - #161971

Open
hanna-kruppe wants to merge 1 commit into
rust-lang:mainfrom
hanna-kruppe:rm-flag-satfpcast
Open

Remove -Zsaturating-float-casts flag#161971
hanna-kruppe wants to merge 1 commit into
rust-lang:mainfrom
hanna-kruppe:rm-flag-satfpcast

Conversation

@hanna-kruppe

@hanna-kruppe hanna-kruppe commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

I added this flag back in 2017 (#45205) to enable benchmarking of the saturating semantics when it was newly implemented and still experimental. But saturation has been the official semantics for float<->int as casts for years now. A flag for turning it off no longer serves any purpose, it's just -Zplease-miscompile-casts now.

@rustbot

rustbot commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

rustc_codegen_cranelift is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_cranelift instead.

cc @bjorn3

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 29, 2026
@rustbot

rustbot commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 20 candidates

@rustbot

This comment has been minimized.

I added this flag back in 2017 to enable benchmarking of the saturating
semantics when it was newly implemented and still experimental. But
saturation has been the official semantics for float<->int `as` casts
for years now. A flag for turning it off no longer serves any purpose,
it's just `-Zplease-miscompile-casts` now.
@hanna-kruppe

hanna-kruppe commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Moved the miri part to rust-lang/miri#5297

The changes to codegen backends can only be separated out by first removing the uses of the flag there, waiting for the next sync, and then removing the rustc flag. That seems unnecessary but will do if the codegen backend maintainers would prefer.

@chenyukang

Copy link
Copy Markdown
Member

@rustbot reroll

@rustbot rustbot assigned mati865 and unassigned chenyukang Aug 29, 2026
@RalfJung

Copy link
Copy Markdown
Member

FWIW it'd have been fine to do the Miri part here. For tiny changes that logically belong to a rustc PR we're not strict. But a separate PR also works. :)

@RalfJung

Copy link
Copy Markdown
Member

Cc @rust-lang/compiler in case someone is attached to this flag.
r? me

r=me if nobody speaks up within the next few days. Thanks for the cleanup!

@rustbot rustbot assigned RalfJung and unassigned mati865 Aug 29, 2026

@bjorn3 bjorn3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing cg_clif in this PR is fine.

View changes since this review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants