This count should mean the number of fields expected in the serialized form,
so if some fields are skipped, they shouldn't be counted
Methods affected:
- Deserializer::deserialize_tuple
- Deserializer::deserialize_tuple_struct
- VariantAccess::tuple_variant
Without this, if it fails, the only information printed is useless:
Preparing a sysroot for Miri (target: x86_64-unknown-linux-gnu)...
fatal error: failed to build sysroot; run `cargo miri setup` to see the error details
warning: this loop could be written as a `for` loop
--> serde/src/private/de.rs:2905:9
|
2905 | while let Some(item) = self.iter.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for item in self.iter.by_ref()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator
= note: `#[warn(clippy::while_let_on_iterator)]` on by default
Panics lead to reporting errors in tests inside of serde_test internals,
returning errors moves the report location to the corresponding assert_tokens
expression
Fixes these being treated as "tests" by `cargo test` in serde_derive:
running 3 tests
test src/internals/check.rs - internals::check::check_remote_generic (line 23) ... FAILED
test src/internals/check.rs - internals::check::check_remote_generic (line 29) ... FAILED
test src/lib.rs - (line 3) ... ok
failures:
---- src/internals/check.rs - internals::check::check_remote_generic (line 23) stdout ----
error: unknown start of token: \u{2026}
--> src/internals/check.rs:25:20
|
4 | struct Generic<T> {…}
| ^
error: cannot find attribute `serde` in this scope
--> src/internals/check.rs:24:3
|
3 | #[serde(remote = "Generic")]
| ^^^^^
|
= note: `serde` is in scope, but it is a crate, not an attribute
error[E0392]: parameter `T` is never used
--> src/internals/check.rs:25:16
|
4 | struct Generic<T> {…}
| ^ unused parameter
|
= help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `T` to be a const parameter, use `const T: usize` instead
---- src/internals/check.rs - internals::check::check_remote_generic (line 29) stdout ----
error: unknown start of token: \u{2026}
--> src/internals/check.rs:31:21
|
4 | struct ConcreteDef {…}
| ^
error: cannot find attribute `serde` in this scope
--> src/internals/check.rs:30:3
|
3 | #[serde(remote = "Generic<T>")]
| ^^^^^
|
= note: `serde` is in scope, but it is a crate, not an attribute