diff --git a/eserde/src/path/path_.rs b/eserde/src/path/path_.rs index 40f4bc4..fc0b98b 100644 --- a/eserde/src/path/path_.rs +++ b/eserde/src/path/path_.rs @@ -51,7 +51,7 @@ impl Path { } /// Returns an iterator with element type [`&Segment`][Segment]. - pub fn iter(&self) -> Segments { + pub fn iter(&self) -> Segments<'_> { Segments { iter: self.segments.iter(), } diff --git a/eserde/tests/compile_fail/malformed_serde_deserialize_with.stderr b/eserde/tests/compile_fail/malformed_serde_deserialize_with.stderr index 2177a2a..e017dc3 100644 --- a/eserde/tests/compile_fail/malformed_serde_deserialize_with.stderr +++ b/eserde/tests/compile_fail/malformed_serde_deserialize_with.stderr @@ -13,60 +13,60 @@ error: expected serde deserialize_with attribute to be a string: `deserialize_wi error[E0277]: the trait bound `TryFromIntError: Deserialize<'_>` is not satisfied --> tests/compile_fail/malformed_serde_deserialize_with.rs:5:5 | -5 | #[serde(alias = "0", deserialize_with = u64_to_u8())] - | ^ the trait `Deserialize<'_>` is not implemented for `TryFromIntError` - | - = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `TryFromIntError` type - = note: for types from other crates check whether the crate offers a `serde` feature flag - = help: the following other types implement trait `Deserialize<'de>`: - &'a [u8] - &'a std::path::Path - &'a str - () - (T,) - (T0, T1) - (T0, T1, T2) - (T0, T1, T2, T3) - and $N others - = note: required for `Result` to implement `Deserialize<'_>` - = note: required for `Result` to implement `EDeserialize<'_>` + 5 | #[serde(alias = "0", deserialize_with = u64_to_u8())] + | ^ the trait `Deserialize<'_>` is not implemented for `TryFromIntError` + | + = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `TryFromIntError` type + = note: for types from other crates check whether the crate offers a `serde` feature flag + = help: the following other types implement trait `Deserialize<'de>`: + &'a [u8] + &'a std::path::Path + &'a str + () + (T,) + (T0, T1) + (T0, T1, T2) + (T0, T1, T2, T3) + and $N others + = note: required for `Result` to implement `Deserialize<'_>` + = note: required for `Result` to implement `EDeserialize<'_>` note: required by a bound in `maybe_invalid_or_missing` - --> src/_macro_impl.rs - | - | pub fn maybe_invalid_or_missing<'de, D, T>( - | ------------------------ required by a bound in this function + --> src/_macro_impl.rs + | + | pub fn maybe_invalid_or_missing<'de, D, T>( + | ------------------------ required by a bound in this function ... - | T: EDeserialize<'de>, - | ^^^^^^^^^^^^^^^^^ required by this bound in `maybe_invalid_or_missing` + | T: EDeserialize<'de>, + | ^^^^^^^^^^^^^^^^^ required by this bound in `maybe_invalid_or_missing` error[E0277]: the trait bound `TryFromIntError: Deserialize<'_>` is not satisfied --> tests/compile_fail/malformed_serde_deserialize_with.rs:7:5 | -7 | #[serde(alias = "1", deserialize_with = false)] - | ^ the trait `Deserialize<'_>` is not implemented for `TryFromIntError` - | - = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `TryFromIntError` type - = note: for types from other crates check whether the crate offers a `serde` feature flag - = help: the following other types implement trait `Deserialize<'de>`: - &'a [u8] - &'a std::path::Path - &'a str - () - (T,) - (T0, T1) - (T0, T1, T2) - (T0, T1, T2, T3) - and $N others - = note: required for `Result` to implement `Deserialize<'_>` - = note: required for `Result` to implement `EDeserialize<'_>` + 7 | #[serde(alias = "1", deserialize_with = false)] + | ^ the trait `Deserialize<'_>` is not implemented for `TryFromIntError` + | + = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `TryFromIntError` type + = note: for types from other crates check whether the crate offers a `serde` feature flag + = help: the following other types implement trait `Deserialize<'de>`: + &'a [u8] + &'a std::path::Path + &'a str + () + (T,) + (T0, T1) + (T0, T1, T2) + (T0, T1, T2, T3) + and $N others + = note: required for `Result` to implement `Deserialize<'_>` + = note: required for `Result` to implement `EDeserialize<'_>` note: required by a bound in `maybe_invalid_or_missing` - --> src/_macro_impl.rs - | - | pub fn maybe_invalid_or_missing<'de, D, T>( - | ------------------------ required by a bound in this function + --> src/_macro_impl.rs + | + | pub fn maybe_invalid_or_missing<'de, D, T>( + | ------------------------ required by a bound in this function ... - | T: EDeserialize<'de>, - | ^^^^^^^^^^^^^^^^^ required by this bound in `maybe_invalid_or_missing` + | T: EDeserialize<'de>, + | ^^^^^^^^^^^^^^^^^ required by this bound in `maybe_invalid_or_missing` error[E0599]: no function or associated item named `deserialize` found for struct `__ImplDeserializeForCoord` in the current scope --> tests/compile_fail/malformed_serde_deserialize_with.rs:3:10 diff --git a/eserde/tests/compile_fail/meta_item_attribute_syntax_bad.stderr b/eserde/tests/compile_fail/meta_item_attribute_syntax_bad.stderr index 156f924..ba6ca15 100644 --- a/eserde/tests/compile_fail/meta_item_attribute_syntax_bad.stderr +++ b/eserde/tests/compile_fail/meta_item_attribute_syntax_bad.stderr @@ -14,8 +14,13 @@ error[E0277]: the trait bound `__ImplEDeserializeForFoo: Deserialize<'_>` is not --> tests/compile_fail/meta_item_attribute_syntax_bad.rs:2:8 | 2 | struct Foo { - | ^^^ the trait `Deserialize<'_>` is not implemented for `__ImplEDeserializeForFoo` + | ^^^ unsatisfied trait bound | +help: the trait `Deserialize<'_>` is not implemented for `__ImplEDeserializeForFoo` + --> tests/compile_fail/meta_item_attribute_syntax_bad.rs:2:1 + | +2 | struct Foo { + | ^^^^^^^^^^ = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `__ImplEDeserializeForFoo` type = note: for types from other crates check whether the crate offers a `serde` feature flag = help: the following other types implement trait `Deserialize<'de>`: diff --git a/eserde/tests/happy/path.rs b/eserde/tests/happy/path.rs index 3cd5423..17e720c 100644 --- a/eserde/tests/happy/path.rs +++ b/eserde/tests/happy/path.rs @@ -33,7 +33,7 @@ where .collect::>() .join("\n- ") ); - for (error, expected) in errors.into_iter().zip(expected.into_iter()) { + for (error, expected) in errors.into_iter().zip(expected) { let path = error.path().expect("No path on error"); assert_eq!(&path.to_string(), expected, "The full error:\n\t{}", error); } diff --git a/eserde_derive/src/emit.rs b/eserde_derive/src/emit.rs index 8aabf13..3ecf094 100644 --- a/eserde_derive/src/emit.rs +++ b/eserde_derive/src/emit.rs @@ -88,7 +88,7 @@ impl<'a> ImplDeserGenerics<'a> { &self, ) -> ( syn::ImplGenerics<'_>, - syn::TypeGenerics, + syn::TypeGenerics<'_>, Option<&syn::WhereClause>, ) { let (impl_generics, _, where_clause) = self.deser_generics.split_for_impl();