You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting many instances of clippy::derive-partial-eq-without-eq (an non-default lint that I like to enable for my code) for auto-generated code from prost/prost-build. E.g.
warning: you are deriving `PartialEq` and can implement `Eq`
--> .../target/debug/build/crate_name-8fbbd81e799a35b3/out/analysis.rs:216:17
|
216 | #[derive(Clone, PartialEq, ::prost::Message)]
| ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
This happens on for example the following protobuf code (which comes from the bazel project):
syntax="proto3";
// ...// A set of fragment options.messageFragmentOptions {
// The name of this set of fragment options.stringname=1;
// The options themselves, in sorted order by name.repeatedOptionoptions=2;
}
// A fragment option.messageOption {
// The name of the option.optionalstringname=1;
// The value of the option.optionalstringvalue=2;
}
For some reason Prost marks Option as implementing Eq, but not FragmentOptions. Which triggers clippy. And I think clippy is right in this case.
Note that there is a workaround available:
mod proto {#![allow(clippy::derive_partial_eq_without_eq)]#![allow(clippy::doc_lazy_continuation)]#![allow(clippy::enum_variant_names)]// ...include!(concat!(env!("OUT_DIR"),"/includes.rs"));}
Most of those are reasonable to ignore for protobuf generated code, but derive_partial_eq_without_eq looks like an actual problem to my eye in the generated code.
The text was updated successfully, but these errors were encountered:
I'm getting many instances of
clippy::derive-partial-eq-without-eq
(an non-default lint that I like to enable for my code) for auto-generated code from prost/prost-build. E.g.This happens on for example the following protobuf code (which comes from the bazel project):
For some reason Prost marks
Option
as implementingEq
, but notFragmentOptions
. Which triggers clippy. And I think clippy is right in this case.Note that there is a workaround available:
Most of those are reasonable to ignore for protobuf generated code, but
derive_partial_eq_without_eq
looks like an actual problem to my eye in the generated code.The text was updated successfully, but these errors were encountered: