Well-formedness of type parameter defaults is not checked #46669
Labels
A-trait-system
Area: Trait system
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This compiles:
This does not:
Even though it's stable, we should probably phase out writing badly formed defaults in declarations.
We also don't check that a dependent default actually implements a given trait when using associated items:
Will compile. The default being applied is conditional on
A
implementingIterator
. May be useful for some hacks but seems bogus.Edit:
We don't even check totally bogus stuff such as:
The text was updated successfully, but these errors were encountered: