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

Generated code causes warning: "type parameter goes unused in function definition" #154

Closed
joshlf opened this issue Feb 14, 2023 · 2 comments
Labels
blocking-next-release This issue should be resolved before we release on crates.io

Comments

@joshlf
Copy link
Member

joshlf commented Feb 14, 2023

Fuchsia reports that, when updating to a more recent version of the Rust toolchain, code generated by zerocopy-derive causes the compiler to emit warnings:

warning: type parameter goes unused in function definition
  --> ../../src/sys/pkg/lib/far/rust/src/lib.rs:80:54
   |
80 | #[derive(PartialEq, Eq, Debug, Clone, Copy, Default, zerocopy::AsBytes, zerocopy::FromBytes)]
   |                                                      ^^^^^^^^^^^^^^^^^
   |
   = help: consider removing the parameter
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
   = note: `-D clippy::extra-unused-type-parameters` implied by `-D warnings`
   = note: this warning originates in the derive macro `zerocopy::AsBytes` (in Nightly builds, run with -Z macro-backtrace for more info)


warning: type parameter goes unused in function definition
  --> ../../src/sys/pkg/lib/far/rust/src/lib.rs:80:73
   |
80 | #[derive(PartialEq, Eq, Debug, Clone, Copy, Default, zerocopy::AsBytes, zerocopy::FromBytes)]
   |                                                                         ^^^^^^^^^^^^^^^^^^^
   |
   = help: consider removing the parameter
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
   = note: this warning originates in the derive macro `zerocopy::FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info)
@joshlf joshlf added the blocking-next-release This issue should be resolved before we release on crates.io label Feb 14, 2023
@djkoloski
Copy link
Member

Looks like rust-lang/rust-clippy#10318

@joshlf
Copy link
Member Author

joshlf commented Feb 14, 2023

Yep, agreed. I'm going to close this. If it turns out that's wrong and there's a different cause, we can re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking-next-release This issue should be resolved before we release on crates.io
Projects
None yet
Development

No branches or pull requests

2 participants