-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Closed
Copy link
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-lazy-normalizationArea: Lazy normalization (tracking issue: #60471)Area: Lazy normalization (tracking issue: #60471)A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.
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)
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-lazy-normalizationArea: Lazy normalization (tracking issue: #60471)Area: Lazy normalization (tracking issue: #60471)A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.