-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types 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
This fails to compile, but it shouldn't:
pub trait Trait {}
pub trait WithAssoc<'a> {
type Assoc;
}
impl<T> Trait for for<'a> fn(T, <T as WithAssoc<'a>>::Assoc) where T: for<'a> WithAssoc<'a> {}
impl WithAssoc<'_> for u8 {
type Assoc = u8;
}
fn main() {
fn impls_trait<T: Trait>() {}
impls_trait::<fn(u8, u8)>;
//~^ ERROR the trait bound `fn(u8, u8): Trait` is not satisfied
}
@rustbot label C-bug T-types A-traits A-associated-items
lcnr
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types 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`.