Skip to content

Resolve unnecessary_transmutes warning in nightly-2025-04-25#30

Merged
dtolnay merged 1 commit intomasterfrom
tobits
Apr 25, 2025
Merged

Resolve unnecessary_transmutes warning in nightly-2025-04-25#30
dtolnay merged 1 commit intomasterfrom
tobits

Conversation

@dtolnay
Copy link
Owner

@dtolnay dtolnay commented Apr 25, 2025

rust-lang/rust#136083

warning: unnecessary transmute
   --> src/diyfp.rs:141:37
    |
141 |                   let u: $mask_type = mem::transmute(d);
    |                                       ^^^^^^^^^^^^^^^^^ help: replace this with: `f32::to_bits(d)`
    |
   ::: src/lib.rs:197:9
    |
197 | /         dtoa! {
198 | |             floating_type: f32,
199 | |             significand_type: u32,
200 | |             exponent_type: i32,
...   |
211 | |             min_power: (-36),
212 | |         };
    | |_________- in this macro invocation
    |
    = note: `#[warn(unnecessary_transmutes)]` on by default
    = note: this warning originates in the macro `diyfp` which comes from the expansion of the macro `dtoa` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unnecessary transmute
   --> src/diyfp.rs:141:37
    |
141 |                   let u: $mask_type = mem::transmute(d);
    |                                       ^^^^^^^^^^^^^^^^^ help: replace this with: `f64::to_bits(d)`
    |
   ::: src/lib.rs:243:9
    |
243 | /         dtoa! {
244 | |             floating_type: f64,
245 | |             significand_type: u64,
246 | |             exponent_type: isize,
...   |
257 | |             min_power: (-348),
258 | |         };
    | |_________- in this macro invocation
    |
    = note: this warning originates in the macro `diyfp` which comes from the expansion of the macro `dtoa` (in Nightly builds, run with -Z macro-backtrace for more info)

@dtolnay dtolnay changed the title Resolve unnecessary_transmuts warning in nightly-2025-04-25 Resolve unnecessary_transmutes warning in nightly-2025-04-25 Apr 25, 2025
    warning: unnecessary transmute
       --> src/diyfp.rs:141:37
        |
    141 |                   let u: $mask_type = mem::transmute(d);
        |                                       ^^^^^^^^^^^^^^^^^ help: replace this with: `f32::to_bits(d)`
        |
       ::: src/lib.rs:197:9
        |
    197 | /         dtoa! {
    198 | |             floating_type: f32,
    199 | |             significand_type: u32,
    200 | |             exponent_type: i32,
    ...   |
    211 | |             min_power: (-36),
    212 | |         };
        | |_________- in this macro invocation
        |
        = note: `#[warn(unnecessary_transmutes)]` on by default
        = note: this warning originates in the macro `diyfp` which comes from the expansion of the macro `dtoa` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: unnecessary transmute
       --> src/diyfp.rs:141:37
        |
    141 |                   let u: $mask_type = mem::transmute(d);
        |                                       ^^^^^^^^^^^^^^^^^ help: replace this with: `f64::to_bits(d)`
        |
       ::: src/lib.rs:243:9
        |
    243 | /         dtoa! {
    244 | |             floating_type: f64,
    245 | |             significand_type: u64,
    246 | |             exponent_type: isize,
    ...   |
    257 | |             min_power: (-348),
    258 | |         };
        | |_________- in this macro invocation
        |
        = note: this warning originates in the macro `diyfp` which comes from the expansion of the macro `dtoa` (in Nightly builds, run with -Z macro-backtrace for more info)
@dtolnay dtolnay merged commit 60c1e95 into master Apr 25, 2025
13 checks passed
@dtolnay dtolnay deleted the tobits branch April 25, 2025 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant