-
-
Notifications
You must be signed in to change notification settings - Fork 767
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
#[serde(flatten)] error behavior is different to normal one #1957
Comments
Is there any reason why you assume that the error message should be identical in both cases? Both seem appropriate and serde can only report one error at a time. Also be careful with combining |
@jonasbb I updated the example and output , it should be better to reflect the problem. My question is , why 'A' is missing the "expected |
@edwin0cheng Maybe check how the macros expand using |
Okay, I think the problem here is the error handling code is different between two structs.
Lines 2519 to 2530 in b0c99ed
Maybe we could collect the __values in there to report the error as how 'B' one do. ? |
I think this is all right as currently implemented. If you do manage to come up with a PR that makes identical error messages in this situation, I would be interested to take a look. |
Example:
Output:
I would expect both errors should be equal, but it is different. Maybe I miss something important here ?
[Edit] A better example and output
The text was updated successfully, but these errors were encountered: