-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clippy::transmute_float_to_int
in const context should not trigger when rust-version is less than 1.83 in Cargo.toml
#13383
Comments
clippy::transmute_float_to_int
in const context should not trigger when rust-version is less than 1.82 in Cargo.toml clippy::transmute_float_to_int
in const context should not trigger when rust-version is less than 1.83 in Cargo.toml
@rustbot label +I-suggestion-causes-error |
The reproducer also doesn't have any warnings: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=87b21a87034fd451c9278971fe6971bb |
In rust 1.83, And it seems that the playground clippy is an older version than the one I used above. |
It seems that in the rust-clippy repo it is conditioned on |
I see. Yeah, looks like those checks were removed in rust-lang/rust#129555 which was merged after the last rust->clippy sync, so that makes sense for why the bug isn't present in the clippy repo yet |
Since this is in the rust repo, I created rust-lang/rust#130305 in the rust repo for it. |
Rollup merge of rust-lang#130305 - tspiteri:clippy-msrv-for-const_float_bits_conv, r=flip1995 Clippy: consider msrv for const context for const_float_bits_conv When `const_float_bits_conv` was stabilized for 1.83.0, clippy lints started to be triggered in const context ignoring MSRV. This PR makes the lints trigger in const context only when the MSRV meets 1.83.0. Fixes rust-lang/rust-clippy#13383.
…onv, r=flip1995 Clippy: consider msrv for const context for const_float_bits_conv When `const_float_bits_conv` was stabilized for 1.83.0, clippy lints started to be triggered in const context ignoring MSRV. This PR makes the lints trigger in const context only when the MSRV meets 1.83.0. Fixes rust-lang/rust-clippy#13383.
Summary
When rust-version is less than 1.83, the suggested code does not compile.
Lint Name
clippy::transmute_float_to_int
Reproducer
Cargo.toml contains:
I tried this code:
I saw this happen:
I expected to see this happen:
No warning as rust 1.82.0 does not support
f32::to_bits
in const context.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: