Warn on types that are PartialEq<Self>
(Debug
, Display
, PartialOrd<Self>
, Hash
) but don't expose dyn PartialEq<dyn Dyncast>
(…)
#2
Labels
Hacktoberfest
A good-for-Hacktoberfest issue. This label is only maintained in October.
priority: someday
If you need this, please let me know!
state: approved
Approved to proceed.
type: documentation
Related to documentation and information.
type: feature
Brand new functionality, features, pages, workflows, endpoints, etc.
work: clear
A known solution is (to be) implemented.
Is your feature request related to a problem? Please describe.
Currently, it's easy to forget to expose a dyncast target for existing functionality, and this can be a bit tricky to debug.
Describe the solution you'd like
The most clear solution would be an additional attribute
#[not_dyncast(…)]
that accepts (token literal) types for which there'd otherwise be a warning.Describe alternatives you've considered
An alternative would be to allow negative targets (i.e.
dyn !Trait
), but that's less obvious and potentially leads to parsing difficulties once the never-type is available.Additional context
Specifying a literal type with
not_dyncast
but also exposing it should be statically checked and turned into a compile-time error.The text was updated successfully, but these errors were encountered: