Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error reporting about mismatched signature in with and default attributes #2558

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Mingun
Copy link
Contributor

@Mingun Mingun commented Aug 7, 2023

This PR changes the errors reported by rustc when signature of function specified in

  • #[serde(with = "...")]
  • #[serde(deserialize_with = "...")]
  • #[serde(serialize_with = "...")]
  • #[serde(default = "...")]

is wrong. With this PR error will point to the "...".

@Mingun
Copy link
Contributor Author

Mingun commented Aug 7, 2023

Strange, but order of implementations shown in failed run is different from my (my removed, GitHub runner added):

    = help: the following other types implement trait `Serializer`:
-             FlatMapSerializer<'a, M>
-             &'a mut Formatter<'b>
              _::_serde::__private::ser::content::ContentSerializer<E>
+             FlatMapSerializer<'a, M>
+             &'a mut Formatter<'b>

This can create difficulties in local testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant