Skip to content

Opaque type doesn't find super traits impls #677

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

Closed
detrumi opened this issue Jan 30, 2021 · 1 comment
Closed

Opaque type doesn't find super traits impls #677

detrumi opened this issue Jan 30, 2021 · 1 comment
Assignees
Labels
C-chalk-solve Issues related to the chalk-solve crate

Comments

@detrumi
Copy link
Member

detrumi commented Jan 30, 2021

Opaque types currently don't find impls for super traits.
Originally found here: rust-lang/rust-analyzer#7273

This test should succeed, but currently doesn't find a solution:

program {
    trait Base {}
    trait Super where Self: Base {}
    impl Base for () {}
    impl Super for () {}

    opaque type Opaque: Super = ();
}

goal {
    Opaque: Base
} yields {
    "Unique"
}

I'm assuming we need to generate Implemented clauses for all super traits, like we do for dyn Trait types.

@detrumi detrumi self-assigned this Jan 30, 2021
@jackh726 jackh726 added the C-chalk-solve Issues related to the chalk-solve crate label Feb 1, 2021
bors added a commit that referenced this issue Feb 17, 2021
Generate clauses for super traits of opaque bounds

Implements #677

Turns out that push_dyn_ty_impl_clauses can also be used for opaque types.
@detrumi
Copy link
Member Author

detrumi commented Feb 17, 2021

Fixed by #677

@detrumi detrumi closed this as completed Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-chalk-solve Issues related to the chalk-solve crate
Projects
None yet
Development

No branches or pull requests

2 participants