Open
Description
I tried this code:
#![feature(associated_type_defaults)]
trait Trait {
type A;
}
trait Other<T>
where
T: Trait<A = Self::A>,
{
type A = T::A;
}
See playground.
I expected the associated type default to compile since the bound is valid when implementing the trait. In my mind type A = T::A
should be compatible with the T: Trait<A = Self::A>
constraint;
Instead, this happened:
error[E0275]: overflow evaluating the requirement `<Self as UnsizedVisitor<T>>::A == _`
--> src/lib.rs:12:14
|
12 | type A = T::A;
| ^^^^
Meta
rustc --version --verbose
:
binary: rustc
commit-hash: 794c12416b2138064af1f2746646973fafd9419d
commit-date: 2025-02-21
host: x86_64-pc-windows-msvc
release: 1.87.0-nightly
LLVM version: 20.1.0