fix clippy warnings#1
Conversation
|
Hi @haryu703, thanks for creating this. Sorry that I haven't been able to review the changes. |
|
@geky Thank you for responding. I updated the PR to fix new clippy warnings. Following is the output of $ cargo +stable clippy --all-features
warning: unexpected `cfg` condition value: `8`
--> src/p.rs:232:1
|
232 | #[p(u=usize)] pub type psize;
| ^^^^^^^^^^^^^
|
= note: expected values for `target_pointer_width` are: `16`, `32`, and `64`
= note: using a cfg inside a attribute macro will use the cfgs from the destination crate and not the ones from the defining crate
= help: try referring to `p` crate for guidance on how handle this unexpected cfg
= help: the attribute macro `p` may come from an old version of the `gf256_macros` crate, try updating your dependency with `cargo update -p gf256_macros`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
= note: this warning originates in the attribute macro `p` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unexpected `cfg` condition value: `128`
--> src/p.rs:232:1
|
232 | #[p(u=usize)] pub type psize;
| ^^^^^^^^^^^^^
|
= note: expected values for `target_pointer_width` are: `16`, `32`, and `64`
= note: using a cfg inside a attribute macro will use the cfgs from the destination crate and not the ones from the defining crate
= help: try referring to `p` crate for guidance on how handle this unexpected cfg
= help: the attribute macro `p` may come from an old version of the `gf256_macros` crate, try updating your dependency with `cargo update -p gf256_macros`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: this warning originates in the attribute macro `p` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: `gf256` (lib) generated 2 warnings
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s2 warnings are related to this code. Could I remove |
|
I was curious about this. This seems to have broken even outside of clippy, which is a bit annoying given that the code hasn't changed. And doesn't that warning seem a bit... naive? Given that 128-bit hardware already exists? At least it's fair to say 8-bit processors will never exist. Feel free to add |
|
This warning was introduced in Rust 1.80.0 and expanded in 1.84.0. Expected values are automatically set. If 8-bit/128-bit rust-lang/rust#65473 may be related to this. |
When I used
gfmacro, I encountered following warnings in generated code.This PR fixes these warnings.
Test:
$ cargo clippy --all-features Finished dev [unoptimized + debuginfo] target(s) in 0.02sNote:
This PR may bump MSRV of this crate.