The problem is that the Display derive adds a bounds for all types that
are used in the format string. But this is not necessary for types that
don't contain a type variable. And adding those bounds can result in
errors like for the following code:
error[E0275]: overflow evaluating the requirement `ItemStruct: derive_more::Display`
Solution
This makes sure we don't add unnecessary bounds for Display-like
derives. It does so in the same way as #371 did for the Debug derive: By
only adding bounds when the type contains a type variable.
Checklist
[x] Tests are added/updated (if required)
Changelog is not updated because the 0.99 did not have this issue.
Only put Display-like bounds on type variables
Resolves #363 Requires #377 Related to #371
Synopsis
The problem is that the
Display
derive adds a bounds for all types that are used in the format string. But this is not necessary for types that don't contain a type variable. And adding those bounds can result in errors like for the following code:That code would generate the following error:
Solution
This makes sure we don't add unnecessary bounds for Display-like derives. It does so in the same way as #371 did for the Debug derive: By only adding bounds when the type contains a type variable.
Checklist
Changelog is not updated because the 0.99 did not have this issue.