Skip to content

trait selection fails for projections under binders #102052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aliemjay opened this issue Sep 20, 2022 · 1 comment
Open

trait selection fails for projections under binders #102052

aliemjay opened this issue Sep 20, 2022 · 1 comment
Labels
A-associated-items Area: Associated items (types, constants & functions) A-trait-system Area: Trait system C-bug Category: This is a bug. fixed-by-next-solver Fixed by the next-generation trait solver, `-Znext-solver`. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@aliemjay
Copy link
Member

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

@rustbot rustbot added A-associated-items Area: Associated items (types, constants & functions) A-trait-system Area: Trait system C-bug Category: This is a bug. T-types Relevant to the types team, which will review and decide on the PR/issue. labels Sep 20, 2022
@lcnr

This comment has been minimized.

@lcnr lcnr added the fixed-by-next-solver Fixed by the next-generation trait solver, `-Znext-solver`. label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) A-trait-system Area: Trait system C-bug Category: This is a bug. fixed-by-next-solver Fixed by the next-generation trait solver, `-Znext-solver`. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants