Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eserde/src/path/path_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
Expand Down
92 changes: 46 additions & 46 deletions eserde/tests/compile_fail/malformed_serde_deserialize_with.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8, TryFromIntError>` to implement `Deserialize<'_>`
= note: required for `Result<u8, TryFromIntError>` 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<u8, TryFromIntError>` to implement `Deserialize<'_>`
= note: required for `Result<u8, TryFromIntError>` 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<u8, TryFromIntError>` to implement `Deserialize<'_>`
= note: required for `Result<u8, TryFromIntError>` 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<u8, TryFromIntError>` to implement `Deserialize<'_>`
= note: required for `Result<u8, TryFromIntError>` 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>`:
Expand Down
2 changes: 1 addition & 1 deletion eserde/tests/happy/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ where
.collect::<Vec<_>>()
.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);
}
Expand Down
2 changes: 1 addition & 1 deletion eserde_derive/src/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading