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

Use the #[diagnostic::on_unimplemented] attribute when possible #2767

Merged

Conversation

weiznich
Copy link
Contributor

@weiznich weiznich commented Jul 2, 2024

This change enables the #[diagnostic::on_unimplemented] attribute for the Serialize and Deserialize trait to point the user to the relevant derives and point out that they might want to check crates features for external types by adding the relevant hints an note.

The help text is up for discussion, but I feel that this might help quite a lot of users that struggle why external crates do not implement the serde traits.

This change enables the `#[diagnostic::on_unimplemented]` attribute for
the `Serialize` and `Deserialize` trait to point the user to the
relevant derives and point out that they might want to check crates
features for external types by adding the relevant hints an note.
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I've added a test for this in #2769.

@dtolnay dtolnay merged commit 8e6637a into serde-rs:master Jul 6, 2024
15 checks passed
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.

3 participants