Skip to content

Sync upstream/main#57

Open
jedel1043 wants to merge 45 commits intoboa-dev:mainfrom
jedel1043:sync-upstream
Open

Sync upstream/main#57
jedel1043 wants to merge 45 commits intoboa-dev:mainfrom
jedel1043:sync-upstream

Conversation

@jedel1043
Copy link
Member

Sync with upstream/master.

All changes were cherry-picked from the commit range ce04e720ac1ec4c75ffbf6ffaefe528a467bc263..3131fd6b2405a1fa921797b00b5a4fba4fa0ef87.

    warning: duplicated attribute
      --> tests/s2f_test.rs:26:5
       |
    26 |     clippy::cast_possible_wrap,
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
    note: first defined here
      --> tests/s2f_test.rs:25:5
       |
    25 |     clippy::cast_possible_wrap,
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    help: remove this attribute
      --> tests/s2f_test.rs:26:5
       |
    26 |     clippy::cast_possible_wrap,
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
       = note: `-W clippy::duplicated-attributes` implied by `-W clippy::all`
       = help: to override `-W clippy::all` add `#[allow(clippy::duplicated_attributes)]`
This reverts commit 5402d270591e9eccce21956fc25dacf2e95d83fb.
    warning: value assigned to `vp` is never read
       --> src/f2s.rs:146:17
        |
    146 |                 vp /= 10;
        |                 ^^^^^^^^
        |
        = help: maybe it is overwritten before being read?
        = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default

It is unused in the C code as well except for:

    #ifdef RYU_DEBUG
      printf("V+=%u\nV =%u\nV-=%u\n", vp, vr, vm);
    #endif
Since nightly-2025-10-18 the lint is posted on the impl block, not on
the trait method.
    warning: use of `offset` with a literal
     --> src/pretty/exponent.rs:9:18
      |
    9 |         result = result.offset(1);
      |                  ^^^^^^^^^^^^^^^^
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
      = note: `-W clippy::ptr-offset-by-literal` implied by `-W clippy::pedantic`
      = help: to override `-W clippy::pedantic` add `#[allow(clippy::ptr_offset_by_literal)]`
    help: use `add` instead
      |
    9 -         result = result.offset(1);
    9 +         result = result.add(1);
      |

    warning: use of `offset` with a literal
      --> src/pretty/exponent.rs:18:37
       |
    18 |         ptr::copy_nonoverlapping(d, result.offset(1), 2);
       |                                     ^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `add` instead
       |
    18 -         ptr::copy_nonoverlapping(d, result.offset(1), 2);
    18 +         ptr::copy_nonoverlapping(d, result.add(1), 2);
       |

    warning: use of `offset` with a literal
      --> src/pretty/exponent.rs:35:18
       |
    35 |         result = result.offset(1);
       |                  ^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `add` instead
       |
    35 -         result = result.offset(1);
    35 +         result = result.add(1);
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:20:13
       |
    20 |             result.offset(-2),
       |             ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    20 -             result.offset(-2),
    20 +             result.sub(2),
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:25:13
       |
    25 |             result.offset(-4),
       |             ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    25 -             result.offset(-4),
    25 +             result.sub(4),
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:30:13
       |
    30 |             result.offset(-6),
       |             ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    30 -             result.offset(-6),
    30 +             result.sub(6),
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:35:13
       |
    35 |             result.offset(-8),
       |             ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    35 -             result.offset(-8),
    35 +             result.sub(8),
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:38:18
       |
    38 |         result = result.offset(-8);
       |                  ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    38 -         result = result.offset(-8);
    38 +         result = result.sub(8);
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:52:13
       |
    52 |             result.offset(-2),
       |             ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    52 -             result.offset(-2),
    52 +             result.sub(2),
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:57:13
       |
    57 |             result.offset(-4),
       |             ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    57 -             result.offset(-4),
    57 +             result.sub(4),
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:60:18
       |
    60 |         result = result.offset(-4);
       |                  ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    60 -         result = result.offset(-4);
    60 +         result = result.sub(4);
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:67:13
       |
    67 |             result.offset(-2),
       |             ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    67 -             result.offset(-2),
    67 +             result.sub(2),
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:70:18
       |
    70 |         result = result.offset(-2);
       |                  ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    70 -         result = result.offset(-2);
    70 +         result = result.sub(2);
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:76:13
       |
    76 |             result.offset(-2),
       |             ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    76 -             result.offset(-2),
    76 +             result.sub(2),
       |

    warning: use of `offset` with a literal
      --> src/pretty/mantissa.rs:80:10
       |
    80 |         *result.offset(-1) = b'0' + output as u8;
       |          ^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
    help: use `sub` instead
       |
    80 -         *result.offset(-1) = b'0' + output as u8;
    80 +         *result.sub(1) = b'0' + output as u8;
       |
    warning: variables can be used directly in the `format!` string
      --> tests/d2s_table_test.rs:50:9
       |
    50 |         assert_eq!(*entry, unsafe { compute_pow5(i as u32) }, "entry {}", i);
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
       = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]`
    help: change this to
       |
    50 -         assert_eq!(*entry, unsafe { compute_pow5(i as u32) }, "entry {}", i);
    50 +         assert_eq!(*entry, unsafe { compute_pow5(i as u32) }, "entry {i}");
       |

    warning: variables can be used directly in the `format!` string
      --> tests/d2s_table_test.rs:57:9
       |
    57 |         assert_eq!(*entry, unsafe { compute_inv_pow5(i as u32) }, "entry {}", i);
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    57 -         assert_eq!(*entry, unsafe { compute_inv_pow5(i as u32) }, "entry {}", i);
    57 +         assert_eq!(*entry, unsafe { compute_inv_pow5(i as u32) }, "entry {i}");
       |
    warning: variables can be used directly in the `format!` string
      --> tests/f2s_test.rs:67:9
       |
    67 |         assert!(!f.is_finite(), "f={}", f);
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
       = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]`
    help: change this to
       |
    67 -         assert!(!f.is_finite(), "f={}", f);
    67 +         assert!(!f.is_finite(), "f={f}");
       |

    warning: variables can be used directly in the `format!` string
      --> tests/d2s_test.rs:74:9
       |
    74 |         assert!(!f.is_finite(), "f={}", f);
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
       = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]`
    help: change this to
       |
    74 -         assert!(!f.is_finite(), "f={}", f);
    74 +         assert!(!f.is_finite(), "f={f}");
       |
Superseded by `rust-version` in Cargo.toml.
    warning: casts from `u32` to `u64` can be expressed infallibly using `From`
      --> tests/exhaustive.rs:45:29
       |
    45 |             let increment = (max - min + 1) as u64;
       |                             ^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: an `as` cast can become silently lossy if the types change in the future
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
       = note: `-W clippy::cast-lossless` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_lossless)]`
    help: use `u64::from` instead
       |
    45 -             let increment = (max - min + 1) as u64;
    45 +             let increment = u64::from(max - min + 1);
       |
@jedel1043 jedel1043 requested review from a team and HalidOdat February 28, 2026 19:54
@jedel1043 jedel1043 added the sync label Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants