debug-ignore icon indicating copy to clipboard operation
debug-ignore copied to clipboard

Incompatible with prost

Open palfrey opened this issue 3 months ago • 1 comments

I'm trying to use this to ignore a field I was previously ignoring with derivative, but this library doesn't seem to support it properly. My use case is ignoring the data field of a prost-generated message, namely pub data: ::debug_ignore::DebugIgnore<::prost::bytes::Bytes>. Doing this gets the error:

error[E0277]: the trait bound `DebugIgnore<prost::bytes::Bytes>: BytesAdapter` is not satisfied
  --> nativelink-proto/genproto/google.bytestream.pb.rs:50:28
   |
50 | #[derive(Clone, PartialEq, ::prost::Message)]
   |                            ^^^^^^^^^^^^^^^^ the trait `BytesAdapter` is not implemented for `DebugIgnore<prost::bytes::Bytes>`
   |
   = help: the following other types implement trait `BytesAdapter`:
             Vec<u8>
             prost::bytes::Bytes
note: required by a bound in `prost::encoding::bytes::encoded_len`
  --> external/rules_rust++crate+crates__prost-0.13.5/src/encoding.rs:743:5
   = note: this error originates in the derive macro `::prost::Message` which comes from the expansion of the macro `length_delimited` (in Nightly builds, run with -Z macro-backtrace for more info)

which is fine without the DebugIgnore

palfrey avatar Oct 13 '25 10:10 palfrey