serde icon indicating copy to clipboard operation
serde copied to clipboard

Point to type instead of field for missing traits

Open jonasbb opened this issue 4 years ago • 0 comments

In issue #2103 it was noted that spans for missing Deserialize implementations include the doc comment. This commit changes it to explicitly use the type of each field, as this is the behavior nightly rust has. This is done for both Deserialize and Serialize.

At the same time this fixes two places where no span was used, thus the error message would point at the derive attribute instead of the problematic field. Both cases concern the ude of Default::default().

Compiletests currently only run on nightly, which does not have this issue. Therefore I'm not sure if this can be tested or needs a test.

Closes #2103

jonasbb avatar Oct 26 '21 23:10 jonasbb