+ if $field.is_none() {
+ #[cfg(not(debug_assertions))] {
+ // In general, MaybeReadable implementations are required to consume all the bytes
+ // of the object even if they don't understand it, but due to a bug in the
+ // serialization format for `impl_writeable_tlv_based_enum_upgradable` we sometimes
+ // don't know how many bytes that is. In such cases, we'd like to spuriously allow
+ // TLV length mismatches, which we do here by calling `eat_remaining` so that the
+ // `s.bytes_remain()` check in `_decode_tlv_stream_range` doesn't fail.
+ $reader.eat_remaining()?;
+ }
+ }