Skip to content
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

od: lint error legacy_numeric_constants with Rust 1.79.0 #6475

Closed
lcheylus opened this issue Jun 17, 2024 · 0 comments · Fixed by #6477
Closed

od: lint error legacy_numeric_constants with Rust 1.79.0 #6475

lcheylus opened this issue Jun 17, 2024 · 0 comments · Fixed by #6477
Labels

Comments

@lcheylus
Copy link
Contributor

When checking lint errors with Rust v1.79.0 (cargo clippy), I have an "usage of a legacy numeric method" error with cargo clippy in src/uu/od/src/partialreader.rs (line 154).

$ cargo clippy --all-targets -puu_od -- -W clippy::manual_string_new -D warnings
(...)
    Checking uucore v0.0.26 (/home/fox/dev/Perso/rust-coreutils.git/src/uucore)
    Checking uu_od v0.0.26 (/home/fox/dev/Perso/rust-coreutils.git/src/uu/od)
error: usage of a legacy numeric method
   --> src/uu/od/src/partialreader.rs:154:20
    |
154 |             usize::max_value() as u64,
    |                    ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    = note: `-D clippy::legacy-numeric-constants` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::legacy_numeric_constants)]`
help: use the associated constant instead
    |
154 |             usize::MAX as u64,
    |                    ~~~

error: could not compile `uu_od` (lib test) due to 1 previous error

This check for "legacy_numeric_constants" (see https://rust-lang.github.io/rust-clippy/master/index.html#/legacy_numeric_constants) was added in Rust version 1.79.0.

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 a pull request may close this issue.

2 participants