Closed
Description
Feel free to close if duplicated.
pub trait Foo<TY> {
type FooAssociatedTy;
}
pub trait Bar {
type BarAssociatedTy;
fn send<T>()
where
T: Foo<Self::BarAssociatedTy>,
T::FooAssociatedTy: Send;
}
impl Bar for () {
type BarAssociatedTy = ();
fn send<T>()
where
T: Foo<()>,
T::FooAssociatedTy: Send,
{
}
}
Taking aside the errors, a diagnostic suggests adding a weird T: Foo<()> + Foo<()>
bound.
Things that will make everything compile:
- Remove
T::FooAssociatedTy: Send
(https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=e67dbf2eb726ee22d3470f2a082b1980) - Remove
TY
(https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=3b8275f7670e6a82dc9cd459815e66a9) - Remove
type BarAssociatedTy
(https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=745e08b27876ac261ad2bf9178b2cc79)