Trait bounds don't work on default associated types #67187
Labels
A-associated-items
Area: Associated items (types, constants & functions)
C-bug
Category: This is a bug.
F-associated_type_defaults
`#![feature(associated_type_defaults)]`
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Trait bounds fail for default associated types, but not for re-assigned associated types.
The following code does not compile as seen in this playground.
This gives the error
error[E0277]: the trait bound `<Foo as T>::Item: std::default::Default` is not satisfied
But the code does compile if
impl T for Foo {}
is replaced withas seen on this playground
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: